i try to count files in folder, but readdir function skip on files that contains unicode characters. I am using dirent, in c.
int filecount(char* path)
{
int file_Count=0;
DIR* dirp;
struct dirent * entry;
dirp = opendir(path);
while((entry=readdir(dirp)) !=NULL)
{
if(entry->d_type==DT_REG)
{
++file_Count;
}
}
closedir(dirp);
return file_Count;
}
Try to change
to
which should enable you to count these files by further counting files of unknown types.
Note that,
strcmp(entry->d_name,".")==0
andstrcmp(entry->d_name,"..")==0
are used to exclude sub-directories.