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

62008RE: 'backupcopy' and Windows Vista symbolic links

Expand Messages
  • Craig Barkhouse
    Jul 20, 2011
    • 0 Attachment
      > -----Original Message-----
      > From: vim_dev@... [mailto:vim_dev@...] On
      > Behalf Of Benjamin Fritz
      > Sent: Thursday, July 07, 2011 8:02 AM
      > To: Bram Moolenaar
      > Cc: vim_dev
      > Subject: Re: 'backupcopy' and Windows Vista symbolic links
      >
      > On Thu, Jul 7, 2011 at 6:34 AM, Bram Moolenaar <Bram@...>
      > wrote:
      > >
      > > 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-und
      > >> er-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?
      > >
      >
      > Yes, the "Vim without Cream" install for 7.3.206. I'm not running as
      > administrator, but required admin access to create the links. That doesn't affect
      > anything, does it? I can try again from the admin account later if it might.

      The mch_is_linked() function in os_win32.c only checks if there is more than one hard link (i.e. name) for the file. It doesn't check if the file is a symbolic link. By contrast the Unix code does check if the file is a symbolic link.

      Sounds like a TODO item.

      Craig

      --
      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