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 #50 received at 12366 <at> debbugs.gnu.org (full text, mbox):

From: John Darrington <john <at> darrington.wattle.id.au>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Bernhard Voelker <mail <at> bernhard-voelker.de>, gnu-prog-discuss <at> gnu.org,
	12366 <at> debbugs.gnu.org, John Darrington <john <at> darrington.wattle.id.au>
Subject: Re: [gnu-prog-discuss] bug#12366:  Writing unwritable files
Date: Thu, 6 Sep 2012 19:17:15 +0000
[Message part 1 (text/plain, inline)]
On Thu, Sep 06, 2012 at 11:23:21AM -0700, Paul Eggert wrote:
     On 09/06/2012 10:35 AM, Bernhard Voelker wrote:
     > Why can't 'sed -i' be made atomic for the user?
     > Today, it creates a temporary file for the output.
     > At the end, it calls rename(). What if it instead
     > rewinds the input and that temporary file and copies
     > it's content to the input file?
     
     That's kind of what 'sort -o' does, and it also
     has race conditions.  For example, in that last phase
     while it's copying the content to the input file, some other
     process might be reading the input file.

I don't think that matters. In fact I like to be able to use 
tail -f to see what's being written to a file, and find it
the mozilla like behaviour, where I have to wait until the 
entire file is downloaded in order to see the first byte, 
rather annoying.
     
J'

-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://keys.gnupg.net or any PGP keyserver for public key.

[signature.asc (application/pgp-signature, inline)]

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.