void printFileInfo(ReadOnlyFileSystem fs, string filename) { FileStat stat; writef("'%s'\t", filename); if (!fs.stat(filename, stat)) { writeln("ERROR"); return; } if (stat.isFile) writefln("%u", stat.sizeInBytes); else if (stat.isDirectory) writeln("DIR"); writefln(" created: %s", to!string(stat.creationTimestamp)); writefln(" modified: %s", to!string(stat.modificationTimestamp)); }
Get file or directory stats.