file permissions with cygwin and gvim.bat

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

file permissions with cygwin and gvim.bat

Donald Mitchell
Hi,

I've installed Vim 6.3 on Windows XP.  I often run gvim.bat (located in
C:\WINDOWS) to get the graphical version of Vim.  However when I do
this, the file it creates has the permissions 770.  I would prefer that
it use my umask or just not be executable.

Does anyone know how to change this behavior?

Fyi...if I run the vim.exe that comes with Cygwin it will create files
with the correct permissions for me, but I don't get the popup graphical
window.

Thanks,
Don


Reply | Threaded
Open this post in threaded view
|

Re: file permissions with cygwin and gvim.bat

A.J.Mechelynck
Donald Mitchell wrote:

> Hi,
>
> I've installed Vim 6.3 on Windows XP.  I often run gvim.bat (located in
> C:\WINDOWS) to get the graphical version of Vim.  However when I do
> this, the file it creates has the permissions 770.  I would prefer that
> it use my umask or just not be executable.
>
> Does anyone know how to change this behavior?
>
> Fyi...if I run the vim.exe that comes with Cygwin it will create files
> with the correct permissions for me, but I don't get the popup graphical
> window.
>
> Thanks,
> Don

Native-Windows programs have no awareness of the unix-like rwxrwxrwx
permissions displayed by Cygwin. On FAT systems, there are only 4
permissions bits, namely read-only, hidden, system, and "archive" which
is not really a permission but a status bit. I suspect that NTFS systems
use a similar scheme but I'm less sure about it.

To have a version of gvim that works only through Cygwin (and
understands /cygdrive/c/Program\ Files but probably not "C:\Program
Files"), download the sources and compile them with the Makefiles "for
Unix", the configure utility, and Cygwin gcc. You may need to install
X11-for-cygwin for it to work though.


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: file permissions with cygwin and gvim.bat

adah
In reply to this post by Donald Mitchell
> Hi,
>
> I've installed Vim 6.3 on Windows XP.  I often run gvim.bat (located
> in C:\WINDOWS) to get the graphical version of Vim.  However when I do
> this, the file it creates has the permissions 770.  I would prefer
> that it use my umask or just not be executable.
>
> Does anyone know how to change this behavior?

No way to change it unless you build gvim by yourself, as Tony says.
NTFS does have fine-grained control on file permissions, but certainly a
non-Cygwin build of gvim knows nothing of the Cygwin umask, which is
really a Unixy hack on the Windows ACL.  I believe the files created by
gvim just inherits the privileges of the directory, unless you change it
(in Windows Explorer, for example) manually.

I personally use `set CYGWIN=nontsec', and do not use the UNIX chmod at
all.  If you use the default setting of Cygwin (ntsec), and create a
`normal' text file that has not `execution bit' set, this file cannot be
opened in Windows with `start'.  I am more at ease to let Cygwin let
loose of the Windows privileges and determine a file's execution status
`smartly', though it is slower.

Best regards,

Yongwei