On Wed, Jul 3, 2019 at 1:09 PM Liam <networkimp...@gmail.com> wrote:

> [Sorry to keep re-posting this; I'm keeping it visible for infrequent
> readers]
>

I'm a frequent reader and I've now seen it four times. IMHO, that's enough.

Jim


>
> 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
>
> --
> 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/1587c3db-4ce5-4572-bbb4-ed43c183d290%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/1587c3db-4ce5-4572-bbb4-ed43c183d290%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAKYY9AKxboobAKk3SqgMUtrbtfRu0%2BaJfGorrEmf%3D7vVnag9cw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to