Paul Eggert wrote: > >> If some other process is writing F > >> while I run 'sed -i F', F is not replaced atomically. > > > How not so? > > For example: > > echo ac >f > sed -i 's/a/b/' f & > sed -i 's/c/d/' f > wait > cat f > > If 'sed' were truly atomic, then the output of this would > always be 'bd'. But it's not.
The file replacement is atomic. The reading of the file is not. Bob