Removing read-only attribute for directories #353
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added a check in func TransferAttributes that strips off an attribute if it's a directory and the attribute is a permission-type attribute that is readonly (555, or "r-xr-xr-x").
Fixes #
Changes proposed in this PR
Tests performed
Ran the entire suite of tests and all passed.
Further info for the reviewer
I considered stripping the permission off for any file type if it was a "posixPermission", regardless of what the permission actually was, but using a light touch seemed like perhaps the best approach. That is to say, rather than doing it to all file types, it's restricted to just directory, and only if the permissions is 555. If the permission is something else that is also read-only, like 444, it won't get trapped and removed, but I haven't seen that so far. The problem of read-only zip contents seems to affect zip files coming from Windows no matter what permissions was set on the Windows side. For a zip created on a Mac, it takes the permissions that were on the files/folders prior to zipping (that is, it doesn't make the files/folders read-only unless they actually were read-only during creation). However, coming from Windows, the contents are always set to read-only regardless of what they were in Windows.
fixes #352
Open Issues