#include <dirent.h>
#include <stdio.h>
#include <string.h>
int isdir(char *pp)
{
struct dirent *mydir;
DIR *rep;
int idir = -1;
rep = opendir(pp);
if (rep != NULL)
{
if ((mydir = readdir(rep)))
{
idir = 0;
}
closedir(rep);
}
return idir;
}
void doAnalyseDir(char *pdir, pdestdir)
{
struct dirent *mydir;
DIR *rep;
char srcfile[256];
rep = opendir(pdir);
if (rep != NULL)
{
while ((mydir = readdir(rep)))
{
if (strcmp(mydir->d_name, ".") != 0 && strcmp(mydir->d_name, "..") != 0)
{
sprintf(srcfile, "%s/%s", pdir, mydir->d_name);
if(isdir(srcfile) == -1)
{
printf("%s\n", srcfile);
}
else
{
doAnalyseDir(srcfile);
}
}
}
closedir(rep);
}
}