Re: [PATCH] Add new option --in-place (original) (raw)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
From: | Pádraig Brady |
---|---|
Subject: | Re: [PATCH] Add new option --in-place |
Date: | Thu, 25 Mar 2010 11:30:45 +0000 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 |
On 24/03/10 12:15, Pádraig Brady wrote:
Also I noticed that
mv -b ./file.tmp ./file
is not atomic because the renames are done like: rename(file,bak); rename(tmp,file);
I summarized the issues involved with replacing files and it was surprisingly popular: http://www.reddit.com/r/programming/comments/bhnab/replacing_a_file_on_unix_is_hard/
It was indirectly suggested there to use hardlinks for atomic backups, which I've amended the attached script to do. Other changes include falling back to cp -a if --attributes-only is not supported, and correctly removing all temp files.
I wonder should mv -b
(and sed -i) use the ln method to
try to be atomic and then fall back to the double rename?
I'll look into it at some stage.
cheers, Pádraig.
rp
Description: Text document
- Re: [PATCH] Add new option --in-place, (continued)
- Re: [PATCH] Add new option --in-place, Pádraig Brady, 2010/03/20
* Re: [PATCH] Add new option --in-place, Jim Meyering, 2010/03/21
* Re: [PATCH] Add new option --in-place, Pádraig Brady, 2010/03/21
* Re: [PATCH] Add new option --in-place, Pádraig Brady, 2010/03/22
* Re: [PATCH] Add new option --in-place, Pádraig Brady, 2010/03/22
* Re: [PATCH] Add new option --in-place, Eric Blake, 2010/03/22
* Re: [PATCH] Add new option --in-place, Pádraig Brady, 2010/03/22
* Re: [PATCH] Add new option --in-place, Jim Meyering, 2010/03/23
* Re: [PATCH] Add new option --in-place, Pádraig Brady, 2010/03/23
* Re: [PATCH] Add new option --in-place, Pádraig Brady, 2010/03/24
* Re: [PATCH] Add new option --in-place,Pádraig Brady <=
- Re: [PATCH] Add new option --in-place, Pádraig Brady, 2010/03/20
- Prev by Date:Re: doc refinement request: re: definition of "word" in "wc" manpage; BUG request
- Next by Date:coreutils patch to multithread md5sum for parallel hashing (ala the HP-UX days)
- Previous by thread:Re: [PATCH] Add new option --in-place
- Next by thread:[PATCH] maint: enforce one small aspect of formatting style: space-before-"("
- Index(es):