module Lock_file: Lock_file
val create : path:string -> message:string -> bool
create ~path ~message
tries to create a file at path
containing the text message
. It returns true on success, false
on failure. Note: there is no way to release the lock or the fd
created inside! It will only be released when the process dies.
val create_exn : path:string -> message:string -> unit
create_exn ~path ~message
is like create
except that it throws
an exception on failure instead of returning a boolean value
val create_pid : path:string -> bool
create_pid ~path
creates a file at path
containing the pid of the process
val create_pid_exn : path:string -> unit
create_pid_exn ~path
creates a file at path
containing the pid of the
process. It throws an exception on failure.
val blocking_create : path:string -> message:string -> unit
blocking_create t
tries to create the lock. If another process holds
the lock this function will wait until it is released.
val is_locked : string -> bool
is_locked path
returns true when the file at path
exists and
is locked, false otherwise.