1 #include <stdio.h>
2 #include <sys/types.h>
3 #include <dirent.h>
4
5 int main()
6 {
7 struct dirent *dp;
8 DIR *dfd = opendir(".");
9 if (dfd != NULL) {
10 while((dp = readdir(dfd)) != NULL)
11 printf("%s\n", dp->d_name);
12 closedir(dfd);
13 }
14 getchar();
15 return 0;
16 }