diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-10-22 22:55:02 +0200 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-10-22 22:55:02 +0200 |
| commit | 3c33d36759a316b8c118b77b3eed040425db8e0a (patch) | |
| tree | 07d5a05ceccf7de043f41ea49e34824e235b0cd9 /userspace/foolshell.c | |
| parent | 9fafc0e4937b039d67031e09843af12e9049cd73 (diff) | |
working on ext2 and readdir syscall
Diffstat (limited to 'userspace/foolshell.c')
| -rw-r--r-- | userspace/foolshell.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/userspace/foolshell.c b/userspace/foolshell.c index 15f26e3..6baeb87 100644 --- a/userspace/foolshell.c +++ b/userspace/foolshell.c @@ -37,7 +37,7 @@ int main(int argc, char **argv) char **tokenize(char *buf) { - + char **token; token=malloc(10*sizeof(char*)); @@ -144,13 +144,15 @@ int process(char *buf) } else if(!strcmp(command,"LS")) { + //fs_dirent dirs[25]; + + fs_dirent *dirs=malloc(sizeof(fs_dirent)*25); - fs_dirent dirs[5]; - int ls=readdir("/dupa",&dirs,5); + int ls=readdir("/dupa",dirs,25); int i; for(i=0;i<ls;i++) { - printf("%i %s%c\n",dirs[i].inode, dirs[i].name, ((dirs[i].type==2)?'/':' ')); + printf("%i %s%c\n",dirs[i].inode, dirs[i].name, ((dirs[i].type==FS_FILE_TYPE_DIR)?'/':' ')); } } |
