attrIsDir

Returns whether the given file attributes are for a directory.

@safe pure nothrow @nogc
bool
attrIsDir
()

Parameters

attributes uint

The file attributes.

Return Value

Type: bool

true if attributes specifies a directory

Examples

import std.exception : assertThrown;

auto dir = deleteme ~ "dir";
auto f = deleteme ~ "f";
scope(exit) dir.rmdir, f.remove;

assert(!dir.exists);
assertThrown!FileException(dir.getAttributes.attrIsDir);

dir.mkdir;
assert(dir.isDir);
assert(dir.getAttributes.attrIsDir);

f.write(".");
assert(!f.isDir);
assert(!f.getAttributes.attrIsDir);

Meta