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

61855Re: 'backupcopy' and Windows Vista symbolic links

Expand Messages
  • Bram Moolenaar
    Jul 7 4:34 AM
      Ben Fritz wrote:

      > :help 'backupcopy' indicates that the default value of "auto" should
      > Do The Right Thing when the file is really a symbolic 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
      > the file is not a link) that is used. When problems are expected, a
      > copy will be made.
      > I confirm that my 'backupcopy' is set to "auto", but when writing to a
      > symbolic link in Windows Vista, the link gets destroyed.
      > The following "fixes" the problem:
      > " for some reason, backupcopy=auto doesn't work on Windows to keep
      > " symbolic links. I use these in my vimfiles directory to override
      > some
      > " runtime files which I really edit in the vim source repository.
      > autocmd BufWritePre ~/vimfiles/* set backupcopy=yes
      > autocmd BufWritePost ~/vimfiles/* set backupcopy&
      > I don't think this ought to be necessary. Am I missing something? If
      > not, this looks like a bug. But, I cannot imagine I'm the first person
      > to notice this.
      > Note, I was lead to this solution (in a roundabout way) from here:
      > http://superuser.com/questions/193872/vim-destroys-symbolic-links-under-windows

      There is the mch_is_linked() function which is supposed to detect links
      on a file. I don't know why it doesn't work in this situation. Are you
      using a recent version of Vim?

      hundred-and-one symptoms of being an internet addict:
      253. You wait for a slow loading web page before going to the toilet.

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ an exciting new programming language -- http://www.Zimbu.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Show all 16 messages in this topic