inthe faq there is this code
could someone please explain this code to me, as I would like to use it and manipulate it, but I cant without understanding it first, and i cant seem to figure out how this whole "dir" thing works - tyCode:/* * This program displays the names of all files in the current directory. */ #include <dirent.h> #include <stdio.h> int main(void) { DIR *d; struct dirent *dir; d = opendir("."); if (d) { while ((dir = readdir(d)) != NULL) { printf("%s\n", dir->d_name); } closedir(d); } return(0); }