ludic/ns-file.html
2026-09-17 22:10:03 +00:00

22 lines
No EOL
3 KiB
HTML
Raw Permalink 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 lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>File — Ludic</title>
<meta name="description" content="Raw file access over the C stdio calls, for programs that read and write their own formats.">
<link rel="stylesheet" href="base.css">
<link rel="stylesheet" href="docs.css">
</head>
<body>
<header class="nav"><div class="wrap nav-in"><a class="brand" href="index.html"><span class="logo">L</span> Ludic</a><button class="nav-toggle" aria-label="Toggle menu" aria-expanded="false">☰</button><nav class="nav-links"><a href="index.html">Home</a><a href="api.html">API Reference</a><a class="nav-cta" href="https://git.workshopsoft.io/workshopsoft/ludic">Source ↗</a></nav></div></header>
<main class="wrap item">
<div class="crumbs"><a href="api.html">API Reference</a> <span>›</span> <span class="here">File</span></div>
<div class="item-head"><span class="kind-badge kind-namespace">namespace</span><h1 id="top">File</h1></div>
<p class="ns-blurb">Raw file access over the C stdio calls, for programs that read and write their own formats. <a href="file-open"><code>File.open</code></a> returns a handle (or <code>null</code>), <a href="file-read"><code>File.read</code></a> / <a href="file-write"><code>File.write</code></a> move bytes through a <code>bytes</code> buffer, <a href="file-seek"><code>File.seek</code></a> / <a href="file-tell"><code>File.tell</code></a> position the cursor, and <a href="file-close"><code>File.close</code></a> releases the handle. For text and structured data prefer the higher-level <code>Fs</code>, <code>Json</code> and <code>Prefs</code> APIs.</p>
<div class="ns-methods"><a class="ns-method" href="file-open.html"><code class="nm-sig">File.open(path: p, mode: m) -&gt; pointer</code><span class="nm-tip">Open a file (fopen); null when it cannot be opened.</span></a><a class="ns-method" href="file-read.html"><code class="nm-sig">File.read(file: f, buffer: b, count: n) -&gt; int</code><span class="nm-tip">Read up to n bytes into a buffer; returns the bytes read.</span></a><a class="ns-method" href="file-write.html"><code class="nm-sig">File.write(file: f, buffer: b, count: n) -&gt; int</code><span class="nm-tip">Write n bytes from a buffer; returns the bytes written.</span></a><a class="ns-method" href="file-seek.html"><code class="nm-sig">File.seek(file: f, offset: o, whence: w)</code><span class="nm-tip">Move the file cursor (0 start, 1 current, 2 end).</span></a><a class="ns-method" href="file-tell.html"><code class="nm-sig">File.tell(file: f) -&gt; int</code><span class="nm-tip">The cursor position in bytes.</span></a><a class="ns-method" href="file-close.html"><code class="nm-sig">File.close(file: f)</code><span class="nm-tip">Close a handle from File.open.</span></a></div>
<a class="back" href="api.html">← All symbols</a>
</main>
<script src="ludic-highlight.js"></script>
<script>Ludic.installCards(); Ludic.flashTarget();</script>
</body></html>