Loading ...
Sorry, an error occurred while loading the content.

Re: Fwd: FW: vimJag6.1.184 save clobbers type & creator?

Expand Messages
  • Bram Moolenaar
    ... If renaming the file never works to preserve the file attributes, then auto should work like yes . Thus the default value of the option should remain
    Message 1 of 2 , Oct 13, 2002
      Benji Fisher wrote:

      > > Benji:
      > >
      > > :set backupcopy=yes
      > >
      > > works to preserve the type & creator codes.
      > I have added an item to the FAQ on this point. (Axel, you may want
      > to copy this.) The question is whether I should add this to the system
      > vimrc file that I distribute. Here is part of what it says under :help
      > 'backupcopy':
      > 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.
      > On the Mac, that + under the "yes" option is important! I am guessing
      > that the extra time is usually not a big deal, but I am not sure if the
      > other - will bother anyone.
      > If this is a good idea, it might be even better to patch the source
      > so that "yes" is the default value of 'backupcopy' on the mac. This has
      > the following (dis)advantages:
      > + With a patch to the docs, no one will wonder where this option got set.
      > + This will affect those who choose to compile their own copies of vim.
      > - I cannot do this on my own. (Although I could post a patch...)
      > Please let me know what you think.

      If renaming the file never works to preserve the file attributes, then
      "auto" should work like "yes". Thus the default value of the option
      should remain "auto" and "auto" should work as intended.

      If there is some knowledge of why the attributes are not preserved when
      writing the file as a new file, then the check for when "auto" may work
      like "no" can be improved. Perhaps it's a matter of using the Unix code
      for Mac OS X?

      hundred-and-one symptoms of being an internet addict:
      210. When you get a divorce, you don't care about who gets the children,
      but discuss endlessly who can use the email address.

      /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
      /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\
      \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
      \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
    Your message has been successfully submitted and would be delivered to recipients shortly.