Name

Fcntl — Fcntl constant module

Synopsis

The Fcntl module provides constant definitions for IO#fcntl.

Required Library

require ‘fcntl’

Constants

F_DUPFD

Duplicates file descriptor

F_GETFD

Reads the close-on-exec flag

F_SETFD

Sets the close-on-exec flags

F_GETFL

Reads the descriptor’s flags

F_SETFL

Gets the descriptor’s flags (O_APPEND, O_NONBLOCK, or O_ASYNC)

F_GETLK

Gets the flock structure

F_SETLK

Gets lock according to the lock structure (nonblocking)

F_SETLKW

Sets lock like F_SETLK (blocking)

F_RDLCK

Reads lock flag for flock structure

F_WRLCK

Writes lock flag for flock structure

F_UNLCK

Unlocks flag for flock structure

FD_CLOEXEC

Close-on-exec flag

O_CREAT

Creates file if it doesn’t exist

O_EXCL

File shouldn’t exist before creation

O_TRUNC

Truncates to length 0

O_APPEND

Appends mode

O_NONBLOCK

Nonblocking mode

O_NDELAY

Nonblocking mode

O_RDONLY

Read-only mode

O_RDWR

Read-write mode

O_WRONLY

Write-only mode

Get Ruby in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.