-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing Issue #615 (grunt.file.copy preserves permissions) #732
Conversation
think it should be the other way around, stating each is a waste of resources unless you really want to preserve so should be false by default. |
thought was that when you care for this kind of performance optimization, you can have it while the default is the least surprising/least problematic behavior: copy with permissions. |
+1 I would really like to see this get merged. |
👍 any updates on this? |
@adambiggs setting Milestone 0.4.2 |
Thanks @vladikoff! |
I've attempted to address this issue in the pr732 branch by creating a new method, file.setPermissions, which gets called inside file.copy. This branch needs to be tested on OS X, Windows and Linux before I can merge it into master (which I would like to do ASAP). Also, please let me know if you see any messages like "platform does not appear to support file permissions" when running the tests, and what OS or shell you see them on. I want this to be as cross-platform as possible. You can see all the changes here: https://github.com/gruntjs/grunt/compare/pr732 |
I'm getting "platform does not appear to support file permissions" on Windows 7 with both git-bash and cmd.exe. See: https://gist.github.com/shama/6896504 |
Does Windows just not support file permissions? You can see what the unit test is trying to do here: https://github.com/gruntjs/grunt/blob/pr732/test/grunt/file_test.js#L444-L449 Basically, if a platform / filesystem supports file permissions, we should support that... but I don't know what we need to do to actually support it everywhere. Ideas, @shama? |
I've just updated the Question: is it possible that when Grunt creates a file, that file will not be able to have its permissions set? Please test the latest |
I just rebased / force-pushed the pr732 branch. Still looking for answers to my questions. Anybody? |
I'll check again this evening on my Windows box. |
From what I gather there could be edge cases with NTFS partitions and IIS Servers. |
Should try and fix this? Oldest pull request here :-) |
unless preservePermissons is explicitly set to false in the options, file.copy will now copy owner, group and mode from the source to the destination.