<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> <link rel="Start" href="index.html"> <link rel="previous" href="Import.html"> <link rel="next" href="Log.html"> <link rel="Up" href="index.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of exceptions" rel=Appendix href="index_exceptions.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Index of module types" rel=Appendix href="index_module_types.html"> <link title="Command" rel="Chapter" href="Command.html"> <link title="File_tail" rel="Chapter" href="File_tail.html"> <link title="File_writer" rel="Chapter" href="File_writer.html"> <link title="Import" rel="Chapter" href="Import.html"> <link title="Lock_file" rel="Chapter" href="Lock_file.html"> <link title="Log" rel="Chapter" href="Log.html"> <link title="Persistent_singleton" rel="Chapter" href="Persistent_singleton.html"> <link title="Rpc" rel="Chapter" href="Rpc.html"> <link title="Rpc_intf" rel="Chapter" href="Rpc_intf.html"> <link title="Std" rel="Chapter" href="Std.html"> <link title="Tcp" rel="Chapter" href="Tcp.html"> <link title="Tcp_file" rel="Chapter" href="Tcp_file.html"> <link title="Typed_tcp" rel="Chapter" href="Typed_tcp.html"> <link title="Typed_tcp_intf" rel="Chapter" href="Typed_tcp_intf.html"> <link title="Unpack_sequence" rel="Chapter" href="Unpack_sequence.html"> <link title="User_and_group" rel="Chapter" href="User_and_group.html"> <link title="Versioned_rpc" rel="Chapter" href="Versioned_rpc.html"> <link title="Versioned_typed_tcp" rel="Chapter" href="Versioned_typed_tcp.html"> <link title="Weak_hashtbl" rel="Chapter" href="Weak_hashtbl.html"><title>Lock_file</title> </head> <body> <div class="navbar"><a class="pre" href="Import.html" title="Import">Previous</a> <a class="up" href="index.html" title="Index">Up</a> <a class="post" href="Log.html" title="Log">Next</a> </div> <h1>Module <a href="type_Lock_file.html">Lock_file</a></h1> <pre><span class="keyword">module</span> Lock_file: <code class="code">sig</code> <a href="Lock_file.html">..</a> <code class="code">end</code></pre><div class="info module top"> <code class="code">Async.Lock_file</code> is a wrapper that provides async equivalents for <code class="code">Core.Lock_file</code>.<br> </div> <hr width="100%"> <pre><span id="VALcreate"><span class="keyword">val</span> create</span> : <code class="type">?message:string -><br> ?close_on_exec:bool -><br> ?unlink_on_exit:bool -> string -> bool Import.Deferred.t</code></pre><div class="info "> <code class="code">create ?message path</code> tries to create a file at <code class="code">path</code> containing the text <code class="code">message</code>, pid if none provided. 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.<br> </div> <pre><span id="VALcreate_exn"><span class="keyword">val</span> create_exn</span> : <code class="type">?message:string -><br> ?close_on_exec:bool -><br> ?unlink_on_exit:bool -> string -> unit Import.Deferred.t</code></pre><div class="info "> <code class="code">create_exn ?message path</code> is like <code class="code">create</code> except that it throws an exception on failure instead of returning a boolean value<br> </div> <pre><span id="VALwaiting_create"><span class="keyword">val</span> waiting_create</span> : <code class="type">?message:string -><br> ?close_on_exec:bool -><br> ?unlink_on_exit:bool -> string -> unit Import.Deferred.t</code></pre><div class="info "> <code class="code">wait_create ~path ~message</code> becomes determined when the file at <code class="code">path</code> gets locked. Equivalent to <code class="code">Core.Std.Lock_file.blocking_create</code>.<br> </div> <pre><span id="VALis_locked"><span class="keyword">val</span> is_locked</span> : <code class="type">string -> bool Import.Deferred.t</code></pre><div class="info "> <code class="code">is_locked path</code> returns true when the file at <code class="code">path</code> exists and is locked, false otherwise.<br> </div> </body></html>