Skip to content

FileMode

[Source]

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

[Source]

new iso create()
: FileMode iso^

Returns


Public fields

var setuid: Bool val

[Source]

true if the SETUID bit is set.


var setgid: Bool val

[Source]

true if the SETGID bit is set.


var sticky: Bool val

[Source]

true if the sticky bit is set.


var owner_read: Bool val

[Source]

true if the owning user can read the file.


var owner_write: Bool val

[Source]

true if the owning user can write to the file.


var owner_exec: Bool val

[Source]

true if the owning user can execute the file.


var group_read: Bool val

[Source]

true if members of the owning group can read the file.


var group_write: Bool val

[Source]

true if members of the owning group can write to the file.


var group_exec: Bool val

[Source]

true if members of the owning group can execute the file.


var any_read: Bool val

[Source]

true if every user can read the file.


var any_write: Bool val

[Source]

true if every user can write to the file.


var any_exec: Bool val

[Source]

`true if every user can execute the file.


Public Functions

exec

[Source]

Set the executable flag for everyone.

fun ref exec()
: None val

Returns


shared

[Source]

Set the write flag for everyone to the same as owner_write.

fun ref shared()
: None val

Returns


group

[Source]

Clear all of the any-user flags.

fun ref group()
: None val

Returns


private

[Source]

Clear all of the group and any-user flags.

fun ref private()
: None val

Returns


Private Functions

_os

[Source]

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

Returns