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: Inconsistent Rename behavior on windows #5620

Closed
syndtr opened this issue Jun 3, 2013 · 2 comments
Closed

os: Inconsistent Rename behavior on windows #5620

syndtr opened this issue Jun 3, 2013 · 2 comments

Comments

@syndtr
Copy link

syndtr commented Jun 3, 2013

What steps will reproduce the problem?
1. create file "a" and "b"
2. run `os.Rename("a", "b")`

What is the expected output?
file "b" should be atomically replaced with file "a" 

What do you see instead?
rename a b: Cannot create a file when that file already exists.

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
windows 8 64-bit


Which version are you using?  (run 'go version')
go version go1.1rc3 windows/amd64


I think it should use MoveFileEx syscall with MOVEFILE_REPLACE_EXISTING flag set instead
of plain MoveFile syscall.
@syndtr
Copy link
Author

syndtr commented Jun 3, 2013

Comment 1:

I'm sorry, turn out similar issue already submitted (issue #3366). For some reason I
forgot to select "All Issue" when trying to search similar issue.

@minux
Copy link
Member

minux commented Jun 3, 2013

Comment 2:

Status changed to Duplicate.

Merged into issue #3366.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants