gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnu-arch-users] Re: tla build-config --hard-links available too (fwd)


From: Pau Aliagas
Subject: [Gnu-arch-users] Re: tla build-config --hard-links available too (fwd)
Date: Thu, 2 Oct 2003 11:03:48 +0200 (CEST)

On 2 Oct 2003, Miles Bader wrote:

> Davide Libenzi <address@hidden> writes:
> > > The same warnings than for get apply:
> > > BE CAREFUL with hardlinks!!
> > 
> > I am currently playing with something like this and it seem to work.  I
> > did a shared library (libflcow.so) that gets loaded with LD_PRELOAD and
> > read a FLCOW_PATH environment variable.  Every file open RDWR inside the
> > paths listed inside the FLCOW_PATH gets decoupled from the link and gets
> > its own local copy.  The libary hooks the open(2) function.
> 
> It would be also useful to make a list of common developer software that
> _doesn't_ break hardlinks.
> 
> Emacs and patch (my main tools!) are OK (they break hardlinks), but is it
> true that vim doesn't?

Vim seems NOT to be safe in the default setup.

You should add ths line to the ~/.vimrc file:
set backupcopy=no       " rename the file and write a new one (preserve links)

Copied from the manual:

-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----
'backupcopy' 'bkc'      string  (Vi default for Unix: "yes", otherwise: "auto")
                        global
                        {not in Vi}
        When writing a file and a backup is made, this option tells how it's
        done:
        "yes"   make a copy of the file and overwrite the original one
        "no"    rename the file and write a new one
        "auto"  one of the previous, what works best

        Making a copy and overwriting the original file:
        - Takes extra time to copy the file.
        + When the file has special attributes, is a (hard/symbolic) link or
          has a resource fork, all this is preserved.
        - When the file is a link the backup will have the name of the link,
          not of the real file.

        Renaming the file and writing a new one:
        + It's fast.
        - Sometimes not all attributes of the file can be copied to the new
          file.
        - When the file is a link the new file will not be a link.

        The "auto" value is the middle way: When Vim sees that renaming file
        is possible without side effects (the attributes can be passed on and
        and the file is not a link) that is used.  When problems are expected,
        a copy will be made.
-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----


Pau





reply via email to

[Prev in Thread] Current Thread [Next in Thread]