On Aug 16, 10:44 am, Aaron Lewis <aaron.lewis1...@gmail.com> wrote: > 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
Thanks for the clarification Aaron. I could be wrong but I don't think this well help. If I run umask on the linux box, I'm running it in a shell - but I'd have thought that any changes I make would be local to that shell - since the vim session is not run in that shell, but on a separate, Windows machine. The only changes that would appear relevant to me would be changes to samba configuration files - but the sys admins have so far said "Well if it works in notepad, and it works in wordpad - it's vim that's broken, not the samba config" - and as yet, I don't know enough to argue. Does that make sense? Thanks, John -- 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