FileMode¶
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
Constructors¶
create¶
new iso create()
: FileMode iso^
Returns¶
- FileMode iso^
Public fields¶
var setuid: Bool val¶
true
if the SETUID bit is set.
var setgid: Bool val¶
true
if the SETGID bit is set.
var sticky: Bool val¶
true
if the sticky bit is set.
var owner_read: Bool val¶
true
if the owning user can read the file.
var owner_write: Bool val¶
true
if the owning user can write to the file.
var owner_exec: Bool val¶
true
if the owning user can execute the file.
var group_read: Bool val¶
true
if members of the owning group can read the file.
var group_write: Bool val¶
true
if members of the owning group can write to the file.
var group_exec: Bool val¶
true
if members of the owning group can execute the file.
var any_read: Bool val¶
true
if every user can read the file.
var any_write: Bool val¶
true
if every user can write to the file.
var any_exec: Bool val¶
`true if every user can execute the file.
Public Functions¶
exec¶
Set the executable flag for everyone.
fun ref exec()
: None val
Returns¶
- None val
shared¶
Set the write flag for everyone to the same as owner_write.
fun ref shared()
: None val
Returns¶
- None val
group¶
Clear all of the any-user flags.
fun ref group()
: None val
Returns¶
- None val
private¶
Clear all of the group and any-user flags.
fun ref private()
: None val
Returns¶
- None val
u32¶
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 u32()
: U32 val
Returns¶
- U32 val