This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Hello and cygwin quesiton

Dear Igor,
I guest there were no improvements on the execute permission problem.

But I just realized that "vi" under cygwin is smart enough
not to give execute permissions to the files it writes
out.  It simply keep the original permissions.   Why can't gvim
do the same?


Igor Pechtchanski wrote:


Well, there are people on this list who are more versed in Windows
permissions issues than I, and hopefully they'll intervene and either
confirm or refute my answer.  If I had to guess, I'd say this has to do
with inheritable permissions -- if a directory has an execute permission
and the flag is set that makes all files and subdirectories inherit that
permission, all your files will be marked executable.  You can try to use
the Windows permissions dialog to uncheck the "allow objects to inherit
permissions" box, and this might solve the problem.  I'm not sure why you
didn't have this problem on Win2k (I do), but it could be because of some
unique permissions setup.

Hope this helps,

On Wed, 1 Oct 2003, Yap on ExactGeom wrote:

Dear Igor,
Nice to hear from you, and thanks for the clarification!

I understand your explanation of the difference between
gvim and vim.  But there is still a mystery.

In my previous installation of cygwin, no such problems
arise.  The difference is that my previous system was Windows 2000
and my current one is Windows XP.  Can you explain this?


Igor Pechtchanski wrote:

On Tue, 30 Sep 2003, Yap on ExactGeom wrote:

Dear Igor,

How are you?  I noticed that you are an active developer of cygwin.
I really liked this platform and our Core Library is developed
on this mainly.   I have a question:

In my recent (June) installation of cygwin, there was an annoying
bug -- many of the files that I create are automatically given
the execute permission.  [Since my "ls" will automatically show
me which files are executable, this is VERY annoying.]
But this behavior is not universal.  If I have a non-executable
file, and I exit it using gvim, the file will become executable.
But using vim, it remains non-executable.  But I don't think
the program is with a bad installation of gvim, because this
phenomenon shows up in other places.

Heard of this bug before?
Thanks, Chee

Hi, Chee,

Great to hear from you.

I'm redirecting this reply to the general Cygwin list, mostly to get this
into the archives (because I know others are having this same problem).
Also, this brings your question up before a large body of expertise --
perhaps someone else will find something I've missed.

This is not a bug, but rather an artifact of the default permissions files
get when written by Windows programs. Gvim is a pure Windows program, in
contrast with vim, which is a Cygwin one. Also, vim writes files
in-place, whereas gvim creates a new copy -- hence the change in
permissions. Unfortunately, there isn't anything you can easily do to fix
this. I have a script (attached) that I run periodically on my system to
fix the executable permissions. It's not foolproof, but it's better than
nothing (and it should err on the conservative side).
[fixexec script snipped]

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]