-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/16/2010 07:56 AM, John wrote:
> On Aug 14, 2:41 pm, Tony Mechelynck <antoine.mechely...@gmail.com>
> wrote:
>> On 12/08/10 06:29, John wrote:
>>> Hi all,
>>
>>> I'm using Vim 7.2.411 on Windows XP (from the Cream web site), to edit
>>> files hosted on a linux server.  I have the linux directory as a
>>> Windows mapped network drive (via samba).
>>
>>> If via the linux box, I set the permissions on a file to 775, I can
>>> edit and save the file in Notepad and Wordpad, through the mapped
>>> network drive, and the permissions are retained.  But if I do the same
>>> editing in Vim, saving the file reverts its permissions to 644.
>>
>>> I'm getting sick of typing 'chmod 775'... and I'd rather not use .*pad
>>> - any tips?
>>
>>> Thank you,
>>> John
>>
>> Try using
>>         :set backupcopy=yes
>>
>> This should overwrite the old file with the new version (using a copy
>> for the backup if any) thus preserving any attributes the file may have.
>> The alternative is renaming the old file as backup and creating a new
>> file for the new version (which is faster, but may sometimes lose some
>> attributes, e.g. when editing from Windows a network file on a Unix server).
>>
>> See :help 'backupcopy'
>>
>> Best regards,
>> Tony.
>> --
>> The word "spine" is, of course, an anagram of "penis".  This is true in
>> almost fifty percent of the languages of the Galaxy, and many people
>> have attempted to explain why.  Usually these explanations get bogged
>> down in silly puns about "standing erect".
>>                 -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
> 
> Thanks for the suggestion Tony - the plot did thicken a little with
> this tip.
> 
> If I set the file as 777, then set backupcopy to yes, then save it, it
> goes to (and stays at) 655.  If I then set backupcopy to auto, as it
> was originally on Windows, then save, the file goes to 644.  Either
> way, the user execute bit on my script is being removed - but the
> treatment of group/other execute bits surprised me.
> 
> It certainly looks to me like some kind of file mask problem and I
> very much suspected Samba settings - but the fact that notepad and
> wordpad get it right suggests it's got to be something about the
> windows vim implementation alone?  I tried going back to the very
> first 7.0 release, but the behaviour was the same.  I've tried from
> two different computers (both XP) - same behaviour.
> 
> Aaron - thanks for the reply - but I don't understand quite what you
> mean.  From where should I be running the umask command - vim?
> windows? linux?
> 

On Linux , where samba server runs.

What if u set up a new umask , before editing any files , will it be
some different ?

* umask 077
* vim a
* ll a
- -rw------- 1 xxx yyy 4 Aug 16 08:36 a

This is just an idea , may not work well.
Or came to your shell configurations e.g ~/.cshrc , set umask bits.

- -- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4R0NL3WI5 on freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxoidUACgkQvf41sEptMqABXACgvBg/aYvX1oQwXNF9JQ5XMGyR
U68AnArmreP/hOWD8A99qVKnX7PoQOKL
=nAe3
-----END PGP SIGNATURE-----

-- 
You received this message from the "vim_use" 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

Reply via email to