Hello i want to create a file crawler that lists all files in hard disk using directory functions in C i have been able to list files in one directory only and haven't been able to crawl through other directories and sub-directories this is what i have so far.
char workingDir[100];
getcwd(workingDir, 100);
printf("Working Dir \t%s\n", workingDir);
//Change dirctory to etc
chdir("/home/Madawar");
getcwd(workingDir, 100);
printf("Changed to \t%s\n", workingDir);
//Dirent stuff
DIR *directory = opendir(workingDir);
struct dirent *dirs;
printf("Directories in %s\n",workingDir);
while((dirs = readdir(directory))!='\0')
{
printf("Dir Name: %s\n\tDir No: %d\nDir Type: %u\n",dirs->d_name,dirs->d_ino,dirs->d_type);
}