#include #include #include #include int main(int argc, char **argv) { DIR *dir; struct dirent *ent; if ((dir = opendir(argv[1])) != NULL) { while ((ent = readdir(dir)) != NULL) { printf("%s\n", ent->d_name); } closedir(dir); } else { return EXIT_FAILURE; } return EXIT_SUCCESS; }