15
0
I am using cygwin on Windows 7 professional.
When I create new files such as MyNewFile.java it seems to get default permission set to 755. This is not what I want. I want it to be 644 for regular files.
This is very annoying to have to change permissions every time I create new files outside of the cygwin terminal (cp from cygwin terminal works fine and just keeps existing permissions as expected, even creating new files from inside cygwin works).
Alternatively, is there any way in git to auto-change *.myextension files to always have a specific permission?
If not, is there any way to recursively chmod 644 all *.myextension files recursively under a folder (without affecting folder permissions!)?
1
@UmaN, I think Casey Crockett's answer would be the solution, yes? It's backed up by this: https://cygwin.com/ml/cygwin/2011-02/msg00121.html
– r_alex_hall – 2016-01-01T20:45:47.9631For fallback solution, this seems to work:
find ./ -type f -name '*.myExtension' -exec chmod 644 {} ; – UmaN – 2013-11-26T10:01:24.983
1Did you give umask a try? – Werner Henze – 2013-11-26T10:55:46.963
umask is 0022. As stated, creating through the cygwin terminal works just fine. The problem occurs when copying files in windows explorer or creating files through e.g. an IDE when programming. This should somehow have something to do with how Windows cygwin treats Windows permissions on folders I suppose... – UmaN – 2013-11-26T12:31:52.183
4@UmaN: A comment on your comment: there’s no good reason to say
find ./ …
;find . …
works just fine, and if you get in the habit of typingfind ./
all the time, one of these days you’re going to typefind / -exec rm …
(or, equivalently,find /. …
) by accident. – Scott – 2013-12-02T22:57:51.833