<!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="File_tail.html"> <link rel="next" href="Import.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>File_writer</title> </head> <body> <div class="navbar"><a class="pre" href="File_tail.html" title="File_tail">Previous</a> <a class="up" href="index.html" title="Index">Up</a> <a class="post" href="Import.html" title="Import">Next</a> </div> <h1>Module <a href="type_File_writer.html">File_writer</a></h1> <pre><span class="keyword">module</span> File_writer: <code class="code">sig</code> <a href="File_writer.html">..</a> <code class="code">end</code></pre><div class="info module top"> <code class="code">File_writer</code> is a thin wrapper around <code class="code">Writer</code> with a couple of extra features: <p> <ul> <li>It keeps track of all the file writers that have been created so that it can iterate over them to find out how many bytes in total they have to write.</li> <li>It keeps track of whether the underlying writer has failed, and if so silently ignores future operations. This can prevent pointlessly filling up a writer's buffer with data that will never go anywhere.</li> </ul> <br> </div> <hr width="100%"> <pre><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> </pre> <pre><span id="VALcreate"><span class="keyword">val</span> create</span> : <code class="type">?append:bool -> string -> <a href="File_writer.html#TYPEt">t</a> Import.Deferred.t</code></pre><div class="info "> <code class="code">create file</code> opens <code class="code">file</code>, creating it if it doesn't exist.<br> </div> <pre><span id="VALwrite"><span class="keyword">val</span> write</span> : <code class="type"><a href="File_writer.html#TYPEt">t</a> -> string -> unit</code></pre><div class="info "> <code class="code">write t s</code> writes <code class="code">s</code> to the file.<br> </div> <pre><span id="VALwrite_substring"><span class="keyword">val</span> write_substring</span> : <code class="type"><a href="File_writer.html#TYPEt">t</a> -> Core.Std.Substring.t -> unit</code></pre> <pre><span id="VALwrite_bigsubstring"><span class="keyword">val</span> write_bigsubstring</span> : <code class="type"><a href="File_writer.html#TYPEt">t</a> -> Core.Std.Bigsubstring.t -> unit</code></pre> <pre><span id="VALschedule_bigstring"><span class="keyword">val</span> schedule_bigstring</span> : <code class="type"><a href="File_writer.html#TYPEt">t</a> -> Core.Std.Bigstring.t -> unit</code></pre> <pre><span id="VALwrite_bin_prot"><span class="keyword">val</span> write_bin_prot</span> : <code class="type"><a href="File_writer.html#TYPEt">t</a> -> 'a Core.Std.Bin_prot.Type_class.writer -> 'a -> unit</code></pre> <pre><span id="VALwrite_sexp"><span class="keyword">val</span> write_sexp</span> : <code class="type">?hum:bool -> <a href="File_writer.html#TYPEt">t</a> -> Core.Std.Sexp.t -> unit</code></pre> <pre><span id="VALmonitor"><span class="keyword">val</span> monitor</span> : <code class="type"><a href="File_writer.html#TYPEt">t</a> -> Import.Monitor.t</code></pre> <pre><span id="VALbytes_to_write"><span class="keyword">val</span> bytes_to_write</span> : <code class="type">unit -> int</code></pre><div class="info "> <code class="code">bytes_to_write ()</code> returns the sum over all async_file_writers of how many bytes they need to write.<br> </div> <pre><span id="VALflushed"><span class="keyword">val</span> flushed</span> : <code class="type"><a href="File_writer.html#TYPEt">t</a> -> unit Import.Deferred.t</code></pre> <pre><span id="VALclose"><span class="keyword">val</span> close</span> : <code class="type"><a href="File_writer.html#TYPEt">t</a> -> unit Import.Deferred.t</code></pre> <pre><span id="VALsexp_of_t"><span class="keyword">val</span> sexp_of_t</span> : <code class="type"><a href="File_writer.html#TYPEt">t</a> -> Sexplib.Sexp.t</code></pre><br> <code class="code">create file</code> opens <code class="code">file</code>, creating it if it doesn't exist.<br> <br> <code class="code">write t s</code> writes <code class="code">s</code> to the file.<br> <br> <code class="code">bytes_to_write ()</code> returns the sum over all async_file_writers of how many bytes they need to write.<br> </body></html>