fcntl.h

line.gif

The following macros are defined in the file fcntl.h.

O_RDONLY Open for read only. When this flag is specified, the flags O_WRONLY and O_RDWR may not be applied.
O_WRONLY Open for write only. When this flag is specified, the flags O_RDONLY and O_RDWR may not be applied.
O_RDWR Open for read and write. When this flag is specified, the flags O_RDONLY and O_WRONLY may not be applied.
O_APPEND Reposition the file pointer to the end of file prior to each write operation.
O_CREAT Create and open file. If the file already exists then this flag is ignored.
O_TRUNC Open and truncate. The file is truncated to zero length and the existing contents are lost. The file must have been opened with write permission.
O_EXCL Open only if file doesn't already exist and flag an error otherwise. This flag may only be applied in conjunction with the flag O_CREAT.
O_TEXT File mode is text (translated).
O_BINARY File mode is binary (untranslated).
O_NOINHERIT Child process doesn't inherit file


Notes

If neither of the flags O_TEXT or O_BINARY is specified then the file defaults to text mode. These flags are mutually exclusive.