ReadOnlyFileSystem.stat

Get file or directory stats.

interface ReadOnlyFileSystem
bool
stat
(
string filename
,)

Examples

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));
}

Meta