windows 8.1 and dirEntries

Stephen Jones siwenjo at gmail.com
Thu Dec 26 07:36:59 PST 2013


Code that was fine on 32 bit XP is ow crashing Windows 8.1:

foreach(string s; dirEntries(directory, SpanMode.shallow)){
   if(endsWith(s, "~")) continue;
   try{
     if(isDir(s)) d ~= s;
   }catch(FileException e){   }finally{}
   try{
     if(isFile(s)){
       if(endsWith(s, sufix)){
         f ~= s;
       }	
     }
   }catch(FileException e){}finally{}
}

The error I receive is:

Bypasses std.file.FileException at std\file.d(2262)
===Bypassed===
std.fileFileException at std\file.d(2262): c:\User\Administrator\: 
Access Denied


The crash occurs when directory is the string:
c:\Documents and Settings
c:\PerfLogs
c:\System Volume Information

but there is no issue opening:
c:\Program Files

I am on a 64 bit machine compiling into 32 bit but wouldn't any 
problem there be caught in the try .. catch block? And how come 
the try .. catch block is being bypassed?


More information about the Digitalmars-d-learn mailing list