"q4 ok"
This commit is contained in:
parent
cc7f3c53f2
commit
f53bb0c3cf
@ -4,7 +4,7 @@
|
||||
* @ Copyright: Creative Common 4.0 (CC BY 4.0)
|
||||
* @ Create Time: 04-09-2020 11:43:11
|
||||
* @ Modified by: JunkJumper
|
||||
* @ Modified time: 04-09-2020 12:31:46
|
||||
* @ Modified time: 10-09-2020 10:47:45
|
||||
* @ Description: code c produisant le même résultat qu'un ls.
|
||||
*/
|
||||
|
||||
@ -28,10 +28,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
dir = opendir(argv[1]);
|
||||
entry = readdir(dir);
|
||||
printf("%-10s %-5s %-30s\n", "Inode", "Type", "Nom de Fichier");
|
||||
while(entry != NULL) {
|
||||
printf("%s - %d", entry->d_name, entry->d_ino);
|
||||
printf("%-10d %-5d %-30s\n", (int)entry->d_ino, entry->d_type, entry->d_name);
|
||||
entry = readdir(dir);
|
||||
}
|
||||
closedir(dir);
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user