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

syscall: windows doesn't allow renames for read-only files #35043

Open
zx2c4 opened this issue Oct 21, 2019 · 4 comments
Open

syscall: windows doesn't allow renames for read-only files #35043

zx2c4 opened this issue Oct 21, 2019 · 4 comments
Labels
Documentation NeedsFix The path to resolution is known, but the work has not been done. OS-Windows
Milestone

Comments

@zx2c4
Copy link
Contributor

zx2c4 commented Oct 21, 2019

On Windows, right now we map the lack of the writable bit in Unix file permissions to FILE_ATTRIBUTES_READONLY. This sort of works fine, but this actually prohibits rename-in-place, whereas it's allowed on Unix.

I'm not suggesting that we change this mapping to something else right now, but in case things pop up down the line related to this, here's a bug to track it.

cc @bcmills @alexbrainman

@bcmills bcmills added this to the Unplanned milestone Oct 21, 2019
@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 21, 2019
@bcmills
Copy link
Contributor

bcmills commented Oct 21, 2019

CC @jayconrod

Is there anything to actively do for this issue? (Should we leave it open, or close it and just use it as a point of reference?)

@networkimprov
Copy link

At least we should document the behavior.

@slrz
Copy link

slrz commented Oct 21, 2019

The file system behaviour itself is already documented as part of the OS. As long as Go doesn't do anything special to prevent the rename, that's exactly where that documentation should live.

It might make sense to document the mapping of Unix permission bits to Windows file attributes though.

@bcmills
Copy link
Contributor

bcmills commented Oct 22, 2019

@slrz, the Go os and syscall packages map to Windows system calls in a non-trivial way, particularly where file permissions are concerned. The documentation supplied “as part of the OS” does not describe that mapping.

@bcmills bcmills added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation NeedsFix The path to resolution is known, but the work has not been done. OS-Windows
Projects
None yet
Development

No branches or pull requests

4 participants