This stores a UNIX-style mode broken out into a Bool for each bit. For other operating systems, the mapping will be approximate. For example, on Windows, if the file is readable all the read Bools will be set, and if the file is writeable, all the write Bools will be set.
The default mode is read/write for the owner, read-only for everyone else.
class ref FileMode
new iso create() : FileMode iso^
true
if the SETUID bit is set.
true
if the SETGID bit is set.
true
if the sticky bit is set.
true
if the owning user can read the file.
true
if the owning user can write to the file.
true
if the owning user can execute the file.
true
if members of the owning group can read the file.
true
if members of the owning group can write to the file.
true
if members of the owning group can execute the file.
true
if every user can read the file.
true
if every user can write to the file.
`true if every user can execute the file.
Set the executable flag for everyone.
fun ref exec() : None val
Set the write flag for everyone to the same as owner_write.
fun ref shared() : None val
Clear all of the any-user flags.
fun ref group() : None val
Clear all of the group and any-user flags.
fun ref private() : None val
Get the OS specific integer for a file mode. On Windows, if any read flag is set, the path is made readable, and if any write flag is set, the path is made writeable.
fun box _os() : U32 val
© 2016-2018, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/files-FileMode