-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Open
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.OS-Windows
Milestone
Description
On Windows 10, in Go 1.13, it used to be possible to rename over a read only file (like it is in Unix). In Go 1.14 it is not. I'm not seeing anything specific about this in the release notes, was this an intentional change?
func TestRenameRO(t *testing.T) {
os.Remove("a")
os.Remove("b")
defer os.Remove("a")
defer os.Remove("b")
if err := ioutil.WriteFile("a", []byte("some data"), 0644); err != nil { // rw
t.Fatal(err)
}
if err := ioutil.WriteFile("b", []byte("some data"), 0444); err != nil { // ro
t.Fatal(err)
}
if err := os.Rename("a", "b"); err != nil {
t.Error(err)
}
}
PS C:\Users\JakobBorg\dev\test> go1.13.9 test
PASS
ok _/C_/Users/JakobBorg/dev/test 0.048s
PS C:\Users\JakobBorg\dev\test> go1.14.1 test
--- FAIL: TestRenameRO (0.01s)
rename_test.go:22: rename a b: Access is denied.
FAIL
exit status 1
FAIL _/C_/Users/JakobBorg/dev/test 0.046s
PS C:\Users\JakobBorg\dev\test>
Metadata
Metadata
Assignees
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.OS-Windows