Guest User

Untitled

a guest
Jan 23rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <sys/types.h>
  3. #include <dirent.h>
  4.  
  5. int
  6. main (void)
  7. {
  8. DIR *dp;
  9. struct dirent *ep;
  10.  
  11. dp = opendir ("./");
  12. if (dp != NULL)
  13. {
  14. while (ep = readdir (dp))
  15. puts (ep->d_name);
  16. (void) closedir (dp);
  17. }
  18. else
  19. perror ("Couldn't open the directory");
  20.  
  21. return 0;
  22. }
Add Comment
Please, Sign In to add comment