On Aug 14, 2:41 pm, Tony Mechelynck <[email protected]>
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?

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