diff --git a/sys/fs/fat/fat.c b/sys/fs/fat/fat.c index 0d560ae..189145c 100644 --- a/sys/fs/fat/fat.c +++ b/sys/fs/fat/fat.c @@ -135,7 +135,8 @@ } int open_fat(const char *file, fileDescriptor_t *fd) { - FL_FILE *_file = 0x0; + FL_FILE *_file = 0x0; + FL_DIR *_dir = 0x0; assert(fd); assert(fd->mp); @@ -164,7 +165,19 @@ if (!_file) { kprintf( "Not a File Test if Directory?\n" ); - fl_listdirectory( file ); + _dir = kmalloc( sizeof( FL_DIR ) ); + + fl_opendir(file, _dir); + + + fd->offset = 0; + fd->res = _dir; + fd->perms = 0x1; + fd->size = 0x0; + fd->ino = 0x0; + + return( 0x1 ); + return (0x0); } else {