Last active
August 21, 2020 14:11
-
-
Save ozuma/cbb3952387894f44ab88254ebfa03499 to your computer and use it in GitHub Desktop.
View Directory Entry.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <dirent.h> | |
int main(int argc, char *argv[]) | |
{ | |
DIR *dir; | |
struct dirent *dentry; | |
dir = opendir(argv[1]); | |
while (dentry = readdir(dir)) { | |
printf("d_ino:%8i, d_type:%2i, d_name:%s\n", | |
dentry->d_ino, | |
dentry->d_type, | |
dentry->d_name); | |
} | |
closedir(dir); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment