module File::Constants

Module File::Constants defines file-related constants.

There are two families of constants here:

File constants defined for the local process may be retrieved with method File::Constants.constants:

File::Constants.constants.take(5)
# => [:RDONLY, :WRONLY, :RDWR, :APPEND, :CREAT]

File Access

File-access constants may be used with optional argument mode in calls to the following methods:

Read/Write Access

Read-write access for a stream may be specified by a file-access constant.

The constant may be specified as part of a bitwise OR of other such constants.

Any combination of the constants in this section may be specified.

File Positioning

There is no effect on a FIFO special file or a terminal device. The effect on other file types is implementation-defined. The result of using File::TRUNC with File::RDONLY is undefined.

Creating and Preserving

POSIX File Constants

Some file-access constants are defined only on POSIX-compliant systems; those are:

Other File-Access Constants

Locking

Four file constants relate to stream locking; see File#flock:

Filename Globbing Constants (File::FNM_*)

Filename-globbing constants may be used with optional argument flags in calls to the following methods:

The constants are:

Other Constants