If I edit a file with a win32 vim, then the file mode in
CYGWIN is changed to 0755.
Is it possible win32 vim preserves the file mode in cygwin?
regards,
--
namsh
Fuzzy
If you know that you will never be creating executables (not even .bat files,
bash shell scripts or perl scripts) in that directory, try
chmod a-x .
in that directory in Cygwin bash. I'm not sure, but I think it might influence
the Cygwin permissions of files created in that directory in the future. (See
"man chmod" and/or "info chmod" for details.)
Best regards,
Tony.
--
NEIL INNES PLAYED: THE FIRST SELF-DESTRUCTIVE MONK, ROBIN'S LEAST FAVORITE
MINSTREL, THE PAGE CRUSHED BY A RABBIT, THE OWNER OF A DUCK
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
These types of issues have been discussed before on the Cygwin mailing list.
Essentially the issue is with win32 vim only using the default file
permissions (i.e. Inherit permissions from parent) when writing the
updated file. For the behavior you desire win32 vim would need to be
updated to track the actual NTFS permissions and restore them when
using :write.
--
Frodak
The only problem with that would be you couldn't cd into the directory anymore.
:-)
Frodak
Does
:set backupcopy
improve the results?
Best regards,
Tony.
--
"If you ever want to get anywhere in politics, my boy, you're going to
have to get a toehold in the public eye."
Windows programs don't know about Cygwin file permissions.
If vim is changing the Windows ACL permissions (hint: cacls, or Cygwin's
getfacls), that might be a legitimate bug. Otherwise, use Cygwin's vim :-).
--
Matthew
Help! Someone let me off this crazy thing!
Frodak Baksik wrote:
[...]
> These types of issues have been discussed before on the Cygwin mailing list.
>
> Essentially the issue is with win32 vim only using the default file
> permissions (i.e. Inherit permissions from parent) when writing the
> updated file. For the behavior you desire win32 vim would need to be
> updated to track the actual NTFS permissions and restore them when
> using :write.
>
> --
> Frodak
Does
I checked that backupcopy=auto.
The issue seems to be with the swap file. If I open a file with win32
vim, the swap file gets created with the default permissions. Then
when I write the file, the backup copy has the original permissions
but the new file has the default permissions.
When I tried this scenario with Windows Word, its swap file has the
default permissions, but when the file is saved and word is closed the
original permissions are retained. I also tried it with notepad,
wordpad, and visual studio.
Would this be considered a bug with win32 vim on NTFS or is their
another setting to try?
Thanks,
Frodak
Try ":set backupcopy=yes", which is the Unix default and ought to work well in
Cygwin, which is a Unix-like environment.
This ought to give default permissions to the backup and keep the file's
original permissions intact. If, in addition, you have, for example,
:set nobackup writebackup
the backup file won't have a very long lifespan, unless there is a problem.
Best regards,
Tony.
--
Religion has done love a great service by making it a sin.
-- Anatole France
This did the trick. When win32 vim wrote the file back the original
NTFS settings were restored.
Thanks! It worked!
Of course my main development env. is CYGWIN, but a application which I
have to use conflicts with CYGWIN. While I use that program and have to
modify/build a project (sources), I had to use win32 VIM. And it gave me
a headache because of file mode changes.
Regards,
namsh