Module: File::Constants

Included in:
IO
Defined in:
file.c,
file.c

Overview

File::Constants provides file-related constants. All possible file constants are listed in the documentation but they may not all be present on your platform.

If the underlying platform doesn’t define a constant the corresponding Ruby constant is not defined.

Your platform documentations (e.g. man open(2)) may describe more detailed information.

Constant Summary collapse

RDONLY =

open for reading only

INT2FIX(O_RDONLY)
WRONLY =

open for writing only

INT2FIX(O_WRONLY)
RDWR =

open for reading and writing

INT2FIX(O_RDWR)
APPEND =

append on each write

INT2FIX(O_APPEND)
CREAT =

create file if it does not exist

INT2FIX(O_CREAT)
EXCL =

error if CREAT and the file exists

INT2FIX(O_EXCL)
NONBLOCK =

do not block on open or for data to become available

INT2FIX(O_NONBLOCK)
TRUNC =

truncate size to 0

INT2FIX(O_TRUNC)
NOCTTY =

not to make opened IO the controlling terminal device

INT2FIX(O_NOCTTY)
BINARY =

disable line code conversion

INT2FIX(O_BINARY)
SHARE_DELETE =

can delete opened file

INT2FIX(O_SHARE_DELETE)
SYNC =

any write operation perform synchronously

INT2FIX(O_SYNC)
DSYNC =

any write operation perform synchronously except some meta data

INT2FIX(O_DSYNC)
RSYNC =

any read operation perform synchronously. used with SYNC or DSYNC.

INT2FIX(O_RSYNC)
NOFOLLOW =

FreeBSD, Linux

INT2FIX(O_NOFOLLOW)
NOATIME =

Linux

INT2FIX(O_NOATIME)
DIRECT =

Try to minimize cache effects of the I/O to and from this file.

INT2FIX(O_DIRECT)
TMPFILE =

Create an unnamed temporary file

INT2FIX(O_TMPFILE)
LOCK_SH =

shared lock. see File#flock

INT2FIX(LOCK_SH)
LOCK_EX =

exclusive lock. see File#flock

INT2FIX(LOCK_EX)
LOCK_UN =

unlock. see File#flock

INT2FIX(LOCK_UN)
LOCK_NB =

non-blocking lock. used with LOCK_SH or LOCK_EX. see File#flock

INT2FIX(LOCK_NB)
NULL =

Name of the null device

rb_obj_freeze(rb_usascii_str_new2(null_device))