Microsoft recommends changing syscall.Open() for GOOS=windows to fix this. Pls reply if you know of existing apps that rely on it.
This code fails with a "sharing violation" on Windows. That behavior is undocumented in package "os". path := "rename-after-open" fd, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE, 0600) if err != nil { ... } err = os.Rename(path_a, path_b) // or os.Remove(path) if err != nil { ... } // sharing violation fd.Close() In this issue, Microsoft suggested that Go on Windows switch to Unix-like behavior: https://github.com/golang/go/issues/32088 I believe this will happen in pre-release 1.14. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/a6702e0b-93e1-40b6-95e7-40b73701b3a7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.