Closed guy-mograbi-at-gigaspaces closed 9 years ago
What are the permissions you are seeing, what OS are you on, and what version of node
are you running?
i am seeing 664 instead of 775, i run on ubuntu with node 0.10.35.
If you run the following, what do you get?
node --eval 'console.log(process.umask().toString(8))'
I get 2
Interesting, that should mean node
would create files as 775
. Can you try running the following commands and seeing what the permissions are?
node --eval "require('fs').writeFileSync('hello', 'world');"
ls -l hello
-rw-rw-r-- 1 guym guym 5 Jul 29 06:39 hello
Yep, that's 775. Have you tried uninstalling and reinstalling grunt
?
isn't that 664?
this is 775
guym@guym-pcu:~$ chmod 775 hello
guym@guym-pcu:~$ ll hello
-rwxrwxr-x 1 guym guym 5 Jul 29 06:39 hello*
Oh, whoops. Right. It sounds like your umask
is misconfigured somewhere. What's the current umask
set to for your shell?
umask
guym@guym-pcu:~$ umask
0002
Oh, strange. Upon re-reading the documentation, node
is using 0o666
as it's permissions -- on top of which the umask is applied leading to 0o664
.
Upon re-reading ZIP documentation, it looks like it doesn't store filesystem permissions so there is no way to "restore" them.
As an end user, I would prefer the 0o666
as the default case because I don't want any file to become executable upon extraction.
However, I think we should still support your use case. I am open to allowing users to override permissions for all files in a ZIP (e.g. options.mode
). If that is outside of your use case though, I would suggest using something like:
Aaaand never mind again. It looks like we have UNIX permissions:
https://stuk.github.io/jszip/documentation/api_jszip/file_data.html
https://stuk.github.io/jszip/documentation/api_jszip/file_name.html
Alright, I am heads down at the moment on another issue but I will take a look at adding support later tonight.
ok.
fyi - I am using grunt-chmod for now.
and - the same issue exist when I naively implement the unzip task myself using node-unzip
We have added support to save UNIX file permissions upon extraction in 0.17.0
. Thanks for the bug report and quick responses!
thank :smile:. tested and works great.
When I use unzip from command line, I get a file with permission 755.
when I use this grunt plugin, the permissions is different.