My intention is to read every directory and file rooted at a directory given as input in a depth-first manner and towards it I had written a portion(very very initial) of code as shown below.
int main()
{
DIR *fd_dir;
struct dirent *s_dirent;
struct stat buff;
char str[100];
fd_dir = opendir("/home/juggler");
if(fd_dir == 0)
printf("Error opening directory");
while((s_dirent = readdir(fd_dir)) != NULL)
{
printf("\n Name %s",s_dirent->d_name);
}
closedir(fd_dir);
}
Now, the directory juggler has 3 directories say A, B and C but an output to this program not only gives these three directories but also .mozilla .zshrc .gvfs .local .bash_history etc which i do not see when opening juggler normally.
What are these extra things inside juggler and how do I not read them
Thanks