3 ms·
O_APPEND semantics are not consistent for all systems when multiple processes are writing. In early UNIX systems, there was one seek pointer for processes which
by Animats 10y ago
O_APPEND semantics are not consistent for all systems when multiple processes are writing. In early UNIX systems, there was one seek pointer for processes which shared an open file descriptor. This is why multiple commands launched by the shell can write to the same standard output file without overwriting.
But if two processes open the same file for append, in some older versions of Unix they can interfere. POSIX does not guarantee atomicity here. Linux does, mostly, except on NFS. Previous discussion on HN.[1]
This, too, should Just Work.
[1] https://news.ycombinator.com/item?id=12220489 https://news.ycombinator.com/item?id=12220489