1

How can I searches files in current dir and the files in directories that under current dir?

view story
linux-howto

http://stackoverflow.com – The function searches the files in current directory. If It accrosses a directory, It gets in and again searches for file except the current '.' and the previous '..' directory. But It doesnt work how I want.It does not get in the next directory. int foo(char *currDir) { struct dirent *direntp; DIR *dirp; char currentDir[250]; if ((dirp = opendir(currDir)) == NULL) { perror ("Failed to open directory"); return 1; } while ((direntp = readdir(dirp)) != NULL) { printf("%s\n", direntp->d_name); if(direntp->d_type == DT_DIR) { if(strcmp(d (HowTos)