Subject: Re: bug#12366: [gnu-prog-discuss] Writing unwritable files

From: Paul Eggert <[email-masked]>
Date: Thu, 06 Sep 2012 09:35:54 -0700

On 09/06/2012 09:24 AM, Paolo Bonzini wrote:
> A program that reads the target file will never
> be able to observe an intermediate result. 

Sure, but that doesn't fix the race condition I
mentioned.  If some other process is writing F
while I run 'sed -i F', F is not replaced atomically.
That's true even if the other process is another
instance of 'sed'.

While 'sed -i' solves some race conditions,
it doesn't even come close to solving them all.
Fixing this problem in general is above
sed's pay grade, just as it's above shuf's.