This package provides access to platform dependent file locking APIs:
Open file descriptor locking on Linux (
flock(2)locks on UNIX platforms (
Windows locking via LockFileEx (
No-op locking, which throws exceptions (
Lukkomodule exports the best option for the target platform with uniform API.
There are alternative file locking packages:
base >= 4.10is good enough for most use cases. However, uses only
Handles so these locks cannot be used for intra-process locking. (You should use e.g.
filelock doesn't support OFD locking.
Lukko means lock in Finnish.
Lukko.Windows etc are available based on following conditions.
if os(windows) cpp-options: -DHAS_WINDOWS_LOCK elif (os(linux) && flag(ofd-locking)) cpp-options: -DHAS_OFD_LOCKING cpp-options: -DHAS_FLOCK elif !(os(solaris) || os(aix)) cpp-options: -DHAS_FLOCK
Lukko.FLock is available on not (Windows or Solaris or AIX).
Lukko.NoOp is always available.
- Add proper
- Add type-level