Towards working mkdir.

This commit is contained in:
Bahadir Balban
2008-04-14 14:38:04 +01:00
parent d6d97876bb
commit 287b7705da
9 changed files with 83 additions and 17 deletions

View File

@@ -113,14 +113,12 @@ int lsdir(char *path)
if ((fd = open(path, O_RDONLY)) < 0) {
perror("OPEN");
return 0;
} else
printf("OPEN OK.\n");
}
if ((bytes = os_readdir(fd, dents, sizeof(struct dirent) * DENTS_TOTAL)) < 0) {
printf("%s: GETDENTS failed.\n", __TASKNAME__);
perror("GETDENTS\n");
return 0;
} else {
printf("GETDENTS OK.\n");
print_dirents(path, dents, bytes);
}
@@ -135,6 +133,13 @@ int dirtest(void)
printf("\nlsdir root directory:\n");
lsdir("/");
printf("\nCreating directories: usr, etc, tmp, var, home, opt, bin, boot, lib, dev\n");
if (mkdir("/usr", 0) < 0)
perror("MKDIR");
printf("\nlsdir root directory:\n");
lsdir("/");
return 0;
}