Module lrs::file::mode

File mode constants.

Constants

NameDescription
MODE_DIRECTORY

A mode with the default bits for a directory:

  • owner readable

  • owner writable

  • owner executable

  • group readable

  • group executable

  • world readable

  • world executable

MODE_FILE

A mode with the default bits for a file:

  • user readable

  • user writable

  • group readable

  • world readable

MODE_GROUP_EXEC

See the remarks.

This flag has different meanings when applied to regular files and directories.

On regular files

Members of the owning group of this file can execute it.

On directories

Members of the owning group of the directory can read the contents of the directory.

MODE_GROUP_READ

Members of the owning group of the file can read from it.

MODE_GROUP_WRITE

Members of the owning group of the file can write to it.

MODE_SET_GROUP_ID

See the remarks.

MODE_SET_USER_ID

When the file is executed, the effective user id is set to the owner's user id.

MODE_STICKY

Files in a directory with this flag can only be deleted by their owners, the owner of the directory, or a privileged process.

MODE_USER_EXEC

See the remarks.

This flag has different meanings when applied to regular files and directories.

On regular files

The owner of this file can execute it.

On directories

The owner of the directory can read the contents of the directory.

MODE_USER_READ

The owner of the file can read from it.

MODE_USER_WRITE

The owner of the file can write to it.

MODE_WORLD_EXEC

See the remarks.

This flag has different meanings when applied to regular files and directories.

On regular files

Everyone can execute the file.

On directories

Everyone can read the contents of the directory.

MODE_WORLD_READ

Everyone can read from the file.

MODE_WORLD_WRITE

Everyone can write to the file.