Can't call isDir on linux on const object
    Spacen via Digitalmars-d-learn 
    digitalmars-d-learn at puremagic.com
       
    Mon May 19 13:11:42 PDT 2014
    
    
  
The same code works on windows DMD 1.65. But on linux:
delold.d(54): Error: mutable method std.file.DirEntry.isDir is 
not callable using
a const object
[code]
bool printFile(in DirEntry dirEntry, in Duration age, Options 
options)
{
     immutable string type = dirEntry.isDir ? "directory" : 
dirEntry.isFile ? "file" : "unknown";
     if (!options.beQuiet)
         writefln("%s %s, %s is %s days old", type, dirEntry.name,
         dirEntry.timeLastModified, age.total!"days");
     return true;
}
[/code]
    
    
More information about the Digitalmars-d-learn
mailing list