October 19, 2016 Posix access function | ||||
---|---|---|---|---|
| ||||
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? |
October 18, 2016 Re: Posix access function | ||||
---|---|---|---|---|
| ||||
Posted in reply to tcak | 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 |
Copyright © 1999-2021 by the D Language Foundation