Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <dirent.h>
- #include <sys/types.h>
- static void list_dir(const char *path)
- {
- struct dirent *entry;
- DIR *dir = opendir(path);
- if (dir == NULL) {
- return;
- }
- while ((entry = readdir(dir)) != NULL) {
- printf("%s\n",entry->d_name);
- }
- closedir(dir);
- }
Add Comment
Please, Sign In to add comment