GNU bug report logs - #12366
[gnu-prog-discuss] Writing unwritable files

Previous Next

Package: coreutils;

Reported by: Paolo Bonzini <bonzini <at> gnu.org>

Date: Thu, 6 Sep 2012 12:14:01 UTC

Severity: normal

Done: Jim Meyering <meyering <at> hx.meyering.net>

Bug is archived. No further changes may be made.

Full log


Message #35 received at 12366 <at> debbugs.gnu.org (full text, mbox):

From: Bob Proulx <bob <at> proulx.com>
To: gnu-prog-discuss <at> gnu.org, John Darrington <john <at> darrington.wattle.id.au>,
	12366 <at> debbugs.gnu.org
Subject: Re: bug#12366: [gnu-prog-discuss] Writing unwritable files
Date: Thu, 6 Sep 2012 11:12:25 -0600
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




This bug report was last modified 12 years and 232 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.