Posix access function

Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Oct 18 21:48:16 PDT 2016


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



More information about the Digitalmars-d-learn mailing list