natefinch / atomic

atomic is a go package for atomic file writing
MIT License
200 stars 12 forks source link

Question: why is MOVEFILE_WRITE_THROUGH needed? #23

Open hajimehoshi opened 2 years ago

hajimehoshi commented 2 years ago

In the current os.Rename implementationm MoveFileEx is used but with a different flags: https://cs.opensource.google/go/go/+/refs/tags/go1.18.3:src/internal/syscall/windows/syscall_windows.go;l=293

So the difference is whether MOVEFILE_WRITE_THROUGH is used or not. I was wondering why this is needed. If this is needed, should we commit this flag to the Go standard library?

Thanks,