filter hidden files/directorys while using readdir() in the windows environment


/ Published in: C
Save to your folder(s)

filter hidden files/directorys while using readdir() in the windows environment


Copy this code and paste it in your HTML
  1. DIR *pDir = opendir(pathname);
  2. if(!pDir){
  3. return false;
  4. }
  5.  
  6. dirent *pDirEntry;
  7. struct stat entryStat;
  8. while((pDirEntry = readdir(pDir))){
  9. // filter hidden files and / or subdirectorys
  10. if(pDir->dd_dta.attrib & _A_HIDDEN){
  11. continue;
  12. }
  13. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.