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

os: document that os.Rename will overwrite any existing file #13673

Closed
raboof opened this issue Dec 18, 2015 · 5 comments
Closed

os: document that os.Rename will overwrite any existing file #13673

raboof opened this issue Dec 18, 2015 · 5 comments

Comments

@raboof
Copy link

@raboof raboof commented Dec 18, 2015

TestRenameOverwriteDest suggests that on all OS'es except plan9, when the target path of os.Rename already exists, it will be replaced.

It might be nice to add that to the docs: for example on Windows it is not obvious (syscall_windows.go explicitly adds the MOVEFILE_REPLACE_EXISTING flag - there's no way to tell without either looking at the code or testing)

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Dec 18, 2015

Seems like if we are going to document it we should make sure that Plan 9 behaves that way too.

@raboof

This comment has been minimized.

Copy link
Author

@raboof raboof commented Dec 21, 2015

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Dec 21, 2015

os.Rename uses windows.Rename from internal/syscall/windows.

@rsc

This comment has been minimized.

Copy link
Contributor

@rsc rsc commented Jan 6, 2016

Filed #13844 for Plan 9 and will write docs.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 6, 2016

CL https://golang.org/cl/18332 mentions this issue.

@rsc rsc closed this in 5d8442a Jan 7, 2016
@golang golang locked and limited conversation to collaborators Jan 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.