Are there any Phobos functions to check file permissions on Windows and Posix?

FreeSlave via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Sep 7 06:01:54 PDT 2015


On Sunday, 6 September 2015 at 23:05:29 UTC, Jonathan M Davis 
wrote:
>
> http://dlang.org/phobos/std_file.html#.getAttributes will get 
> you all of the file attributes for a file, though you'll have 
> to look at the Windows and POSIX documentation to know how to 
> interpret that.
>
> - Jonathan M Davis

It will give you attributes from owner's point of view (i.e. what 
owner can, what users in the same group can, and what all other 
users can)

Not sure if phobos has functions to check if file is readable or 
writable by current user. You can use access on Posix: 
http://linux.die.net/man/2/access


More information about the Digitalmars-d-learn mailing list