[darcs-users] Re: hardlink by default?

Neal D. Becker ndbecker2 at verizon.net
Fri Dec 24 12:44:28 UTC 2004


Alex Shinn wrote:

> At Thu, 23 Dec 2004 16:34:41 +0100, Tomasz Zielonka wrote:
>> 
>> However... hardlinking would make sense if you could guarantee that when
>> you
>> modify a file, a new i-node is created, ie. by replacing the file.  Some
>> editors, like vim, seem to work like this, but it's not generally true.
> 
> vim *only* does this for files with a hard-link count of 1.  Otherwise
> you'd effectively break the link with the other copies, which would be
> very bad.
> 

Here is the info that documents xemacs behavior, this provides some useful
information:

Prev: Backup Deletion,  Up: Backup

Copying vs. Renaming
....................

You can make backup files by copying the old file or by renaming it.
This makes a difference when the old file has multiple names.  If you
rename the old file into the backup file, the alternate names become
names for the backup file.  If you copy the old file instead, the
alternate names remain names for the file that you are editing, and the
contents accessed by those names will be the new contents.

   How you make a backup file may also affect the file's owner and
group.  If you use copying, they do not change.  If renaming is used,
you become the file's owner, and the file's group becomes the default
(different operating systems have different defaults for the group).

   Having the owner change is usually a good idea, because then the
owner is always the person who last edited the file.  Occasionally
there is a file whose owner should not change.  Since most files should
change owners, it is a good idea to use local variable lists to set
`backup-by-copying-when-mismatch' for the special cases where the owner
should not change (*note File Variables::).

   Three variables control the choice of renaming or copying.
Normally, renaming is done.  If the variable `backup-by-copying' is
non-`nil', copying is used.  Otherwise, if the variable
`backup-by-copying-when-linked' is non-`nil', copying is done for files
that have multiple names, but renaming may still be done when the file
being edited has only one name.  If the variable
`backup-by-copying-when-mismatch' is non-`nil', copying is done if
renaming would cause the file's owner or group to change.







More information about the darcs-users mailing list