enum

File::Permissions

Inherits Enum / Comparable / Value / Object

Represents a set of access permissions for a file. Not all permission sets will be supported on all platforms.

The binary representation of this enum is defined to be same representation as the permission bits of a unix st_mode field. File::Permissions can also be compared to its underlying bitset, for example File::Permissions::All == 0o777 will always be true.

On windows, only the OwnerWrite bit is effective. All file permissions will either be 0o444 for read-only files or 0o666 for read-write files. Directories are always mode 0o555 for read-only or 0o777.

Constants

OtherExecute = 1_i16
OtherWrite = 2_i16
OtherRead = 4_i16
OtherAll = 7_i16
GroupExecute = 8_i16
GroupWrite = 16_i16
GroupRead = 32_i16
GroupAll = 56_i16
OwnerExecute = 64_i16
OwnerWrite = 128_i16
OwnerRead = 256_i16
OwnerAll = 448_i16
None = 0_i16
All = 511_i16

Constructors

new(int : Int)
Source

Instance methods

group_all?

Returns true if this enum value contains GroupAll

Source
group_execute?

Returns true if this enum value contains GroupExecute

Source
group_read?

Returns true if this enum value contains GroupRead

Source
group_write?

Returns true if this enum value contains GroupWrite

Source
none?
Source
other_all?

Returns true if this enum value contains OtherAll

Source
other_execute?

Returns true if this enum value contains OtherExecute

Source
other_read?

Returns true if this enum value contains OtherRead

Source
other_write?

Returns true if this enum value contains OtherWrite

Source
owner_all?

Returns true if this enum value contains OwnerAll

Source
owner_execute?

Returns true if this enum value contains OwnerExecute

Source
owner_read?

Returns true if this enum value contains OwnerRead

Source
owner_write?

Returns true if this enum value contains OwnerWrite

Source
to_s(io : IO) : Nil

Appends a String representation of this enum member to the given io.

See also: to_s.

Source