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


Public fields

  • var setuid: Bool val

  • var setgid: Bool val

  • var sticky: Bool val

  • var owner_read: Bool val

  • var owner_write: Bool val

  • var owner_exec: Bool val

  • var group_read: Bool val

  • var group_write: Bool val

  • var group_exec: Bool val

  • var any_read: Bool val

  • var any_write: Bool val

  • var any_exec: Bool val

Public Functions

exec

Set the executable flag for everyone.

fun ref exec()
: None val

Returns


shared

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

fun ref shared()
: None val

Returns


group

Clear all of the any-user flags.

fun ref group()
: None val

Returns


private

Clear all of the group and any-user flags.

fun ref private()
: None val

Returns


Private Functions

_os

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