M
M
memba2015-09-28 20:07:11
go
memba, 2015-09-28 20:07:11

How to get an exclusive lock on a file in Go in Windows?

Good day!
How to get an exclusive lock on a file in Windows?

fd := file.Fd()
err := syscall.Flock(int(fd), syscall.LOCK_EX|syscall.LOCK_NB)

As I understand it, syscall.Flock is not supported on Windows.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RomanPyr, 2015-09-30
@memba

Try via winapi LockFile (ex).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question