iter/1.1/sequence/SequenceLabels/IO/index.html
2019-03-08 19:15:01 -06:00

2 lines
No EOL
4.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>IO (sequence.SequenceLabels.IO)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> <a href="../../index.html">sequence</a> &#x00BB; <a href="../index.html">SequenceLabels</a> &#x00BB; IO</nav><h1>Module <code>SequenceLabels.IO</code></h1></header><dl><dt class="spec value" id="val-lines_of"><a href="#val-lines_of" class="anchor"></a><code><span class="keyword">val</span> lines_of : ?&#8288;mode:int <span>&#45;&gt;</span> ?&#8288;flags:Pervasives.open_flag list <span>&#45;&gt;</span> string <span>&#45;&gt;</span> string <a href="../index.html#type-t">t</a></code></dt><dd><p><code>lines_of filename</code> reads all lines of the given file. It raises the same exception as would opening the file and read from it, except from <code>End_of_file</code> (which is caught). The file is <b>always</b> properly closed. Every time the sequence is iterated on, the file is opened again, so different iterations might return different results</p><dl><dt>parameter mode</dt><dd><p>default <code>0o644</code></p></dd></dl><dl><dt>parameter flags</dt><dd><p>default: <code>[Open_rdonly]</code></p></dd></dl></dd></dl><dl><dt class="spec value" id="val-chunks_of"><a href="#val-chunks_of" class="anchor"></a><code><span class="keyword">val</span> chunks_of : ?&#8288;mode:int <span>&#45;&gt;</span> ?&#8288;flags:Pervasives.open_flag list <span>&#45;&gt;</span> ?&#8288;size:int <span>&#45;&gt;</span> string <span>&#45;&gt;</span> string <a href="../index.html#type-t">t</a></code></dt><dd><p>Read chunks of the given <code>size</code> from the file. The last chunk might be smaller. Behaves like <a href="index.html#val-lines_of"><code>lines_of</code></a> regarding errors and options. Every time the sequence is iterated on, the file is opened again, so different iterations might return different results</p></dd></dl><dl><dt class="spec value" id="val-write_to"><a href="#val-write_to" class="anchor"></a><code><span class="keyword">val</span> write_to : ?&#8288;mode:int <span>&#45;&gt;</span> ?&#8288;flags:Pervasives.open_flag list <span>&#45;&gt;</span> string <span>&#45;&gt;</span> string <a href="../index.html#type-t">t</a> <span>&#45;&gt;</span> unit</code></dt><dd><p><code>write_to filename seq</code> writes all strings from <code>seq</code> into the given file. It takes care of opening and closing the file.</p><dl><dt>parameter mode</dt><dd><p>default <code>0o644</code></p></dd></dl><dl><dt>parameter flags</dt><dd><p>used by <code>open_out_gen</code>. Default: <code>[Open_creat;Open_wronly]</code>.</p></dd></dl></dd></dl><dl><dt class="spec value" id="val-write_bytes_to"><a href="#val-write_bytes_to" class="anchor"></a><code><span class="keyword">val</span> write_bytes_to : ?&#8288;mode:int <span>&#45;&gt;</span> ?&#8288;flags:Pervasives.open_flag list <span>&#45;&gt;</span> string <span>&#45;&gt;</span> Bytes.t <a href="../index.html#type-t">t</a> <span>&#45;&gt;</span> unit</code></dt><dd><dl><dt>since</dt><dd>0.5.4</dd></dl></dd></dl><dl><dt class="spec value" id="val-write_lines"><a href="#val-write_lines" class="anchor"></a><code><span class="keyword">val</span> write_lines : ?&#8288;mode:int <span>&#45;&gt;</span> ?&#8288;flags:Pervasives.open_flag list <span>&#45;&gt;</span> string <span>&#45;&gt;</span> string <a href="../index.html#type-t">t</a> <span>&#45;&gt;</span> unit</code></dt><dd><p>Same as <a href="index.html#val-write_to"><code>write_to</code></a>, but intercales <code>'\n'</code> between each string</p></dd></dl><dl><dt class="spec value" id="val-write_bytes_lines"><a href="#val-write_bytes_lines" class="anchor"></a><code><span class="keyword">val</span> write_bytes_lines : ?&#8288;mode:int <span>&#45;&gt;</span> ?&#8288;flags:Pervasives.open_flag list <span>&#45;&gt;</span> string <span>&#45;&gt;</span> Bytes.t <a href="../index.html#type-t">t</a> <span>&#45;&gt;</span> unit</code></dt><dd><dl><dt>since</dt><dd>0.5.4</dd></dl></dd></dl></div></body></html>