O_APPEND
O_APPEND is a file-status flag that combines positioning at the current end of a file with each write as one atomic operation.
The status flag belongs to the open file description, so duplicated descriptors share it. Linux documents races when concurrent append is simulated on NFS; do not transfer a local-file guarantee to every network mount. [1] RWF_APPEND requests append for one pwritev2 operation; its supplied offset does not select the write position, while offset -1 also updates the current offset. [2]
Relations
- related
- pwrite, short-write, open-file-description, o-sync, advisory-file-lock
Advantages
- Avoids a separate seek-to-end followed by write for an append operation.
Limitations
- Does not make a multi-call record indivisible or request durable completion.
- Short writes still require byte-count accounting and a concurrency policy.
Citations
- Linux man-pages 6.19: open(2), O_APPEND and open file descriptions
- Linux man-pages 6.19: readv(2), RWF_APPEND and RWF_NOAPPEND