Skip to content
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

Normalize file modes for Windows #956

Merged
merged 1 commit into from
Oct 10, 2020
Merged

Conversation

hairyhenderson
Copy link
Owner

Fixes #948

On Windows, the UNIX chmod values don't work as expected. Basically there are only 3 acceptable modes - read-write (0666), read-only (0444), and no access (0000). To make matters worse, if you create a file with mode 0644, it'll be interpreted as 0444 and the file will not be writeable.

This adds an internal utility to convert the file mode from the intended mode to something that will actually work cross-platform.

Signed-off-by: Dave Henderson [email protected]

@hairyhenderson hairyhenderson force-pushed the fix-windows-file-modes-948 branch from 567dd69 to 5e72366 Compare September 29, 2020 23:37
@hairyhenderson hairyhenderson force-pushed the fix-windows-file-modes-948 branch 4 times, most recently from 665ee47 to b888f63 Compare October 2, 2020 01:33
@hairyhenderson hairyhenderson force-pushed the fix-windows-file-modes-948 branch 4 times, most recently from 5c4749d to 83923f5 Compare October 10, 2020 00:03
@hairyhenderson hairyhenderson force-pushed the fix-windows-file-modes-948 branch from 83923f5 to 91f0cef Compare October 10, 2020 00:09
@hairyhenderson hairyhenderson merged commit ca6552e into master Oct 10, 2020
@hairyhenderson hairyhenderson deleted the fix-windows-file-modes-948 branch October 10, 2020 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows file creation with read-only permissions
1 participant