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

BBasile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Sep 7 08:48:54 PDT 2015


On Sunday, 6 September 2015 at 23:05:29 UTC, Jonathan M Davis 
wrote:
> [...] which makes treating some of this stuff in a 
> cross-platform fashion quite difficult.

And even more with ACLs that it could be:

On windows, to know properly if something is readable or writable 
the attributes are not enough. One should also check the ACL:

https://msdn.microsoft.com/en-us/library/windows/desktop/aa446659(v=vs.85).aspx

For example you can retieve the flags: 
archive/readonly/hidden/system/indexable(?) and even if it looks 
writable or readable, the file won't be open at all because the 
ACL for the file don't include the current user account.




More information about the Digitalmars-d-learn mailing list