UNIX 4.2 file system query
Tom Wood
wood at rtp47.UUCP
Thu Apr 25 00:27:15 AEST 1985
> UNIX 4.2 allows files to be opened in append mode. I would
> like to know if this is "Atomic Append".
>
> For example, if two programs open the same file in append mode,
> and append few blocks to the file then is it true that the blocks
> will be appended in order (that is first all the blocks of first
> program followed by the blocks of the second program, or vice-versa).
>
> Also, if this is true then is the granularity of atomicity is at
> block level or is arbitrary.
> divy
Having a file open in append mode (O_APPEND in BSD 4.2 and FAPPEND
in Sys V) causes the file pointer to be set to the current file size
at each write operation. Since write operations to the same file do
not overlap in time, each process will append data to the file at
the time the write system call is invoked. The data written to the
file in a given write operation will appear as a contiguous sequence
within the file. If the processes do not cooperate, the sequences
of write operations by each process can be arbitrarily interspersed.
--
Tom Wood Data General, Research Triangle Park, NC
{the known world}!mcnc!rti-sel!rtp47!wood
More information about the Comp.unix
mailing list