Posted By

zaxbbun on 01/31/13


Tagged

Readdir


Versions (?)

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


 / Published in: C
 

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

  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  

You need to login to post a comment.