I want to lock file exclusively on Windows environment, but syscall.Flock
isn't supported by Windows.
Is there any way to implement it?
I tried this article's method however it doesn't work (syscall.Syscall6
raises "Access is denied." error).
I want to lock file exclusively on Windows environment, but syscall.Flock
isn't supported by Windows.
Is there any way to implement it?
I tried this article's method however it doesn't work (syscall.Syscall6
raises "Access is denied." error).
Windows c++ api could help you. The LockFile and LockFileEx functions seem enough to help.