uint - represening attributes of the file
Test if file has permission to run
import dshould; import std.conv: octal; Path root = createTempPath(); scope(exit) root.remove(); // Here we have to import bitmasks from system; import core.sys.posix.sys.stat; root.join("test-file.txt").writeFile("Hello World!"); auto attributes = root.join("test-file.txt").getAttributes(); // Test that file has permissions 644 (attributes & octal!644).should.equal(octal!644); // Test that file is readable by user (attributes & S_IRUSR).should.equal(S_IRUSR); // Test that file is not writeable by others (attributes & S_IWOTH).should.not.equal(S_IWOTH);
Get attributes of the path