I could not find a way to preserve both the symbolic link and file permissions 
when saving a file opened via a symbolic link.

If the backupcopy option is "auto" or "no" at the time that the file is 
written, the link is broken, and a new unlinked file with the same name 
replaces the symbolic link.

c:\temp\vim>chmod 777 ../foo.txt

c:\temp\vim>del foo.txt

c:\temp\vim>mklink foo.txt ..\foo.txt
symbolic link created for foo.txt <<===>> ..\foo.txt

c:\temp\vim>dir /a ..\foo.txt foo.txt
Volume in drive C has no label.
Volume Serial Number is 120F-7D5B

Directory of c:\temp

11/30/2011  07:25 AM                17 foo.txt
               1 File(s)             17 bytes

Directory of c:\temp\vim

11/30/2011  07:30 AM    <SYMLINK>      foo.txt [..\foo.txt]
               1 File(s)              0 bytes
               0 Dir(s)  323,489,423,360 bytes free

c:\temp\vim>ls -l ../foo.txt foo.txt
-rwxrwxrwx   1 VERTICAL\JohnJ  VERTICAL\Domain+Users      17 Nov 30 07:25 
../foo.txt
lrwxrwxrwa   1 VERTICAL\JohnJ  VERTICAL\Domain+Users       0 Nov 30 07:30 
foo.txt -> c:/temp/foo.txt

c:\temp\vim>"C:\Program Files\Vim\vim73\gvim.exe" foo.txt

c:\temp\vim>dir /a ..\foo.txt foo.txt
Volume in drive C has no label.
Volume Serial Number is 120F-7D5B

Directory of c:\temp

11/30/2011  07:25 AM                17 foo.txt
               1 File(s)             17 bytes

Directory of c:\temp\vim

11/30/2011  07:30 AM                27 foo.txt
               1 File(s)             27 bytes
               0 Dir(s)  323,489,423,360 bytes free

c:\temp\vim>ls -l ../foo.txt foo.txt
-rwxrwxrwx   1 VERTICAL\JohnJ  VERTICAL\Domain+Users      17 Nov 30 07:25 
../foo.txt
-rwxrwxrwa   1 VERTICAL\JohnJ  VERTICAL\Domain+Users      27 Nov 30 07:30 
foo.txt

If backupcopy is "yes", the link is not broken, but the file referred to by the 
link loses write permission.

c:\temp\vim>chmod 777 ../foo.txt

c:\temp\vim>del foo.txt

c:\temp\vim>mklink foo.txt ..\foo.txt
symbolic link created for foo.txt <<===>> ..\foo.txt

c:\temp\vim>dir /a ..\foo.txt foo.txt
Volume in drive C has no label.
Volume Serial Number is 120F-7D5B

Directory of c:\temp

11/30/2011  07:25 AM                17 foo.txt
               1 File(s)             17 bytes

Directory of c:\temp\vim

11/30/2011  07:32 AM    <SYMLINK>      foo.txt [..\foo.txt]
               1 File(s)              0 bytes
               0 Dir(s)  323,489,386,496 bytes free

c:\temp\vim>ls -l ../foo.txt foo.txt
-rwxrwxrwx   1 VERTICAL\JohnJ  VERTICAL\Domain+Users      17 Nov 30 07:25 
../foo.txt
lrwxrwxrwa   1 VERTICAL\JohnJ  VERTICAL\Domain+Users       0 Nov 30 07:32 
foo.txt -> c:/temp/foo.txt

c:\temp\vim>"C:\Program Files\Vim\vim73\gvim.exe" foo.txt

c:\temp\vim>dir /a ..\foo.txt foo.txt
Volume in drive C has no label.
Volume Serial Number is 120F-7D5B

Directory of c:\temp

11/30/2011  07:32 AM                27 foo.txt
               1 File(s)             27 bytes

Directory of c:\temp\vim

11/30/2011  07:32 AM    <SYMLINK>      foo.txt [..\foo.txt]
               1 File(s)              0 bytes
               0 Dir(s)  323,489,234,944 bytes free

c:\temp\vim>ls -l ../foo.txt foo.txt
-r-xr-xr-a   1 VERTICAL\JohnJ  VERTICAL\Domain+Users      27 Nov 30 07:32 
../foo.txt
lrwxrwxrwa   1 VERTICAL\JohnJ  VERTICAL\Domain+Users       0 Nov 30 07:32 
foo.txt -> c:/temp/foo.txt

The use of "ls" above is via MKS tools.  I get the same results if I use MKS 
"ln -s ../foo.txt ." instead of mklink.

Thanks,
John Johnston

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

Raspunde prin e-mail lui