# fs.constants

commonly used constants for file system operations

Availability
8.3.0
8.3.0
9.2.0
Extends
Object

NOTE

This is an abstract type. Any object of this structure can be used where this type is used.

# Constants

# COPYFILE_EXCL

Availability
8.3.0
8.3.0
9.2.0
COPYFILE_EXCL :Number

The copy operation will fail if dest already exists.


# F_OK

Availability
8.3.0
8.3.0
9.2.0
F_OK :Number

Flag indicating that the file is visible to the calling process. This is useful for determining if a file exists, but says nothing about rwx permissions. Default if no mode is specified.


# O_APPEND

Availability
8.3.0
8.3.0
9.2.0
O_APPEND :Number

Flag indicating that data will be appended to the end of the file.


# O_CREAT

Availability
8.3.0
8.3.0
9.2.0
O_CREAT :Number

Flag indicating to create the file if it does not already exist.


# O_DIRECTORY

Availability
8.3.0
8.3.0
9.2.0
O_DIRECTORY :Number

Flag indicating that the open should fail if the path is not a directory.


# O_DSYNC

Availability
8.3.0
8.3.0
9.2.0
O_DSYNC :Number

Flag indicating that the file is opened for synchronized I/O with write operations waiting for data integrity.


# O_EXCL

Availability
8.3.0
8.3.0
9.2.0
O_EXCL :Number

Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists.


# O_NOCTTY

Availability
8.3.0
8.3.0
9.2.0
O_NOCTTY :Number

Flag indicating that if path identifies a terminal device, opening the path shall not cause that terminal to become the controlling terminal for the process (if the process does not already have one).


# O_NOFOLLOW

Availability
8.3.0
8.3.0
9.2.0
O_NOFOLLOW :Number

Flag indicating that the open should fail if the path is a symbolic link.


# O_NONBLOCK

Availability
8.3.0
8.3.0
9.2.0
O_NONBLOCK :Number

Flag indicating to open the file in nonblocking mode when possible.


# O_RDONLY

Availability
8.3.0
8.3.0
9.2.0
O_RDONLY :Number

Flag indicating to open a file for read-only access.


# O_RDWR

Availability
8.3.0
8.3.0
9.2.0
O_RDWR :Number

Flag indicating to open a file for read-write access.


Availability
8.3.0
8.3.0
9.2.0
O_SYMLINK :Number

Flag indicating to open the symbolic link itself rather than the resource it is pointing to.


# O_SYNC

Availability
8.3.0
8.3.0
9.2.0
O_SYNC :Number

Flag indicating that the file is opened for synchronized I/O with write operations waiting for file integrity.


# O_TRUNC

Availability
8.3.0
8.3.0
9.2.0
O_TRUNC :Number

Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero.


# O_WRONLY

Availability
8.3.0
8.3.0
9.2.0
O_WRONLY :Number

Flag indicating to open a file for write-only access.


# R_OK

Availability
8.3.0
8.3.0
9.2.0
R_OK :Number

Flag indicating that the file can be read by the calling process.


# S_IFBLK

Availability
8.3.0
8.3.0
9.2.0
S_IFBLK :Number

File type constant for a block-oriented device file.


# S_IFCHR

Availability
8.3.0
8.3.0
9.2.0
S_IFCHR :Number

File type constant for a character-oriented device file.


# S_IFDIR

Availability
8.3.0
8.3.0
9.2.0
S_IFDIR :Number

File type constant for a directory.


# S_IFIFO

Availability
8.3.0
8.3.0
9.2.0
S_IFIFO :Number

File type constant for a FIFO/pipe.


# S_IFLNK

Availability
8.3.0
8.3.0
9.2.0
S_IFLNK :Number

File type constant for a symbolic link.


# S_IFMT

Availability
8.3.0
8.3.0
9.2.0
S_IFMT :Number

Bit mask used to extract the file type code.


# S_IFREG

Availability
8.3.0
8.3.0
9.2.0
S_IFREG :Number

File type constant for a regular file.


# S_IFSOCK

Availability
8.3.0
8.3.0
9.2.0
S_IFSOCK :Number

File type constant for a socket.


# S_IRGRP

Availability
8.3.0
8.3.0
9.2.0
S_IRGRP :Number

File mode indicating readable by group.


# S_IROTH

Availability
8.3.0
8.3.0
9.2.0
S_IROTH :Number

File mode indicating readable by others.


# S_IRUSR

Availability
8.3.0
8.3.0
9.2.0
S_IRUSR :Number

File mode indicating readable by owner.


# S_IRWXG

Availability
8.3.0
8.3.0
9.2.0
S_IRWXG :Number

File mode indicating readable, writable, and executable by group.


# S_IRWXO

Availability
8.3.0
8.3.0
9.2.0
S_IRWXO :Number

File mode indicating readable, writable, and executable by others.


# S_IRWXU

Availability
8.3.0
8.3.0
9.2.0
S_IRWXU :Number

File mode indicating readable, writable, and executable by owner.


# S_IWGRP

Availability
8.3.0
8.3.0
9.2.0
S_IWGRP :Number

File mode indicating writable by group.


# S_IWOTH

Availability
8.3.0
8.3.0
9.2.0
S_IWOTH :Number

File mode indicating writable by others.


# S_IWUSR

Availability
8.3.0
8.3.0
9.2.0
S_IWUSR :Number

File mode indicating writable by owner.


# S_IXGRP

Availability
8.3.0
8.3.0
9.2.0
S_IXGRP :Number

File mode indicating executable by group.


# S_IXOTH

Availability
8.3.0
8.3.0
9.2.0
S_IXOTH :Number

File mode indicating executable by others.


# S_IXUSR

Availability
8.3.0
8.3.0
9.2.0
S_IXUSR :Number

File mode indicating executable by owner.


# UV_FS_COPYFILE_EXCL

Availability
8.3.0
8.3.0
9.2.0
UV_FS_COPYFILE_EXCL :Number

alias for COPYFILE_EXCL?


# W_OK

Availability
8.3.0
8.3.0
9.2.0
W_OK :Number

Flag indicating that the file can be written by the calling process.


# X_OK

Availability
8.3.0
8.3.0
9.2.0
X_OK :Number

Flag indicating that the file can be executed by the calling process. This has no effect on Windows (will behave like fs.constants.F_OK).