Index: firmware/common/file.c
===================================================================
--- firmware/common/file.c (revision 24105)
+++ firmware/common/file.c (working copy)
@@ -500,6 +500,11 @@
return -1;
}

+ if(file->attr & FAT_ATTR_DIRECTORY) {
+ errno = EISDIR;
+ return -1;
+ }
+
LDEBUGF( "readwrite(%d,%lx,%ld,%s)\n",
fd,(long)buf,count,write?"write":"read");