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

Comments

@zx2c4
Copy link
Contributor

@zx2c4 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 the OS-Windows label Oct 21, 2019
@bcmills bcmills added this to the Unplanned milestone Oct 21, 2019
@bcmills
Copy link
Member

@bcmills 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

@networkimprov networkimprov commented Oct 21, 2019

At least we should document the behavior.

@slrz
Copy link

@slrz 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
Member

@bcmills 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.