rem: switch(data.filetype){
add: switch(data.fileattr){
context: gboolean GetFileInfo(file_info* thisfileinfo, gboolean isfirstfile) {  cvs_dir_entry data;  int dummy,command,s,t;  memset(&data, 0, sizeof data);  if(isfirstfile==TRUE)    command=0xbc00; //first file  if(isfirstfile==FALSE)    command=0xbd00; //next file    //sometimes the first-file read fails after a partition change  for(t=0;t<2;t++) {    if(ControlMessageWrite(command,(char*)&dummy,0,TIMEOUT)==FALSE) {      Log("failed at 0xbc (requesting first file info).");      return FALSE;    }    if(((s=Read((char*)&data,28,TIMEOUT)))<28) {      if(isfirstfile == FALSE)	break;      Log("failed to bulk read first file info...not retrying");      //Sleep(150);      continue;    }    break;  }  if(s!=28) {    Log("failed to bulk read file info");    return FALSE;  }    if(data.unknown1[0]==0x0f) { //we've already read the last file    Log("Last file.");    return FALSE;  }  {    // filename can, oddly, be padded with 0xff    char *cp = memchr(data.filename, 0xff, sizeof data.filename);    if(cp)      *cp = '\0';    memcpy(thisfileinfo->filename, data.filename, sizeof data.filename);    thisfileinfo->filename[sizeof data.filename] = '\0';  }  thisfileinfo->filesize = le32_to_cpu(data.filesize);  switch(data.filetype){  case 0x10:    thisfileinfo->filetype = FIDIR;    break;  default:    Log("unknown file type");    fprintf(stderr, "type 0x%02x attr 0x%02x\n", data.filetype, data.fileattr);  case 0x20:    thisfileinfo->filetype = FIFILE;    break;  }          return TRUE;}