Ethernet & SD - SD working once.

I think (but am not at all sure) that I am getting a similar problem... here is my code, with the results from some tests as comments near the front

#include <SPI.h>
#include <Ethernet.h>
#include <SD.h>
EthernetServer* server;
typedef unsigned char byte;
typedef unsigned char* addr;
#define BZ 250
byte buffer[BZ+1];
/*

on reload...
starting ethernet
bytes loaded 0
starting server
setup done

on reset...
starting ethernet
bytes loaded 0
starting server
setup done

on reload...
starting ethernet
bytes loaded 24
starting server
setup done
client started
GET / HTTP/1.1
Host:
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,#/#;q=0.8
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Cache-Control: max-age=0
bytes xmit 12481

on reset...
starting ethernet
bytes loaded 24
starting server
setup done

*/

short load(byte id) {
  char fn[] = "@.BIN";
  fn[0] = '@' + id;
  File istream = SD.open(fn,FILE_READ);
  short sz = BZ;
  if(istream) {
    addr to = &buffer[0];
    memset(to,0,sz);
    short d = istream.read();
    while(sz && d != -1) {
      *to = d;
      ++to;
      --sz;
      d = istream.read();
    }
    istream.close();
  }
  return BZ - sz;
}

short xmit(EthernetClient ostream, byte fid) {
  char fname[8] = "*.TXT";
  fname[0] = fid;
  File istream = SD.open(fname,FILE_READ);
  short sz = 0;
  if(istream) {
    byte data = istream.read();
    while(data != 0xFF) {
      ++sz;
      if(ostream)
        ostream.print((char)data);
      data = istream.read();
    }
    istream.close();
  }
  return sz;
}

void setup() {
  Serial.begin(9600);
  unsigned char mac[] = // hidden for security reasons
  unsigned char addr[] = // hidden for security reasons
  unsigned char gate[] = // hidden for security reasons
  unsigned char dnsa[] = // hidden for security reasons
  unsigned char dnsb[] = // hidden for security reasons
  unsigned char mask[] = {255,255,255,  0};
  pinMode(11,INPUT);
  pinMode(12,INPUT);
  pinMode(13,INPUT);
  SD.begin(4); // to use onboard SD card reader
  Serial.println("starting ethernet");
  Ethernet.begin(mac,addr,dnsa,gate,mask);
  delay(1000);
  Serial.print("bytes loaded ");
  Serial.println(load(1));
  Serial.println("starting server");
  server = new EthernetServer(80);
  server->begin();
  Serial.println("setup done");
}
void loop() {
  EthernetClient client = server->available();
  if(client) {
    Serial.println("client started");
    while(client.available()) {
      char c = client.read();
      Serial.print(c);
    }
    short sz = 0;
    sz += xmit(client,'H');
    sz += xmit(client,'1');
    sz += xmit(client,'C');
    sz += xmit(client,'2');
    sz += xmit(client,'J');
    sz += xmit(client,'3');
    char* t = "elves[CLOCK].C = new Date();";
    client.println(t); sz += strlen(t);
    t = "sPage();";
    client.println(t); sz += strlen(t);
    sz += xmit(client,'4');
    Serial.print("bytes xmit ");
    Serial.println(sz);
    delay(10);
    client.stop();
  }
}

I am using a Mega2560 with the standard(?) Ethernet card with the microSD reader built in and have jumpered:
Mega pin 50 to card pin 12
Mega pin 51 to card pin 11
Mega pin 52 to card pin 13

My symptom is pure intermittent: sometimes it works and sometimes it doesn't, with no determinable set of conditions to indicate which. Given the above comments, I'll try fiddling with pin 10 and see whether the symptom goes away... difficult to distinguish between 'fixed' and 'less frequent' in this sort of case.