www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Posix access function

reply tcak <1ltkrs+3wyh1ow7kzn1k sharklasers.com> writes:
Checked std.stdio, std.file, std.path, couldn't have found anyway 
to check permissions on a file for read, write, execute.

Without getting into core module, does it exist anywhere in std 
module?
Oct 18 2016
parent Jonathan M Davis via Digitalmars-d-learn writes:
On Wednesday, October 19, 2016 04:29:30 tcak via Digitalmars-d-learn wrote:
 Checked std.stdio, std.file, std.path, couldn't have found anyway
 to check permissions on a file for read, write, execute.

 Without getting into core module, does it exist anywhere in std
 module?
On POSIX, std.file.getAttributes or attributes on a std.file.DirEntry will give you st_mode from the stat system call. http://www.unix.com/man-page/FreeBSD/2/stat/ The flags that st_mode uses are declared in core.sys.posix.sys.stat, and the rwx permissions for owner, group, and other are all there as described in the man page. - Jonathan M Davis
Oct 18 2016