Under heavy development. This site describes the intended 1.0 language. Current features and performance vary. Development status
Sn50SnThe SnAPI programming language
Snapshot · Oct 24, 2026 · Frozen documentation

WholeFileBlockingWork

Captures a borrowed path for whole-file byte reading. Copies only the path view without opening a file, scheduling or validating native units. The parent task retains the backing loan through the worker's complete open/read/close composition; moving this value does not retain that owner.

Sn is under heavy development. This reference includes the intended 1.0 design; features may be incomplete in the current compiler. Read the status →

Module std.fs

import std.fs;

Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.

pub init(Path: PathView)

pub init(Path: PathView)

Captures a borrowed path for whole-file byte reading. Copies only the path view without opening a file, scheduling or validating native units. The parent task retains the backing loan through the worker's complete open/read/close composition; moving this value does not retain that owner. Path: Native path view whose backing remains live through completion.

Invoke

pub readonly fn Invoke() -> Result<Vector<byte>, StreamReadError>

Runs open/stream-transfer/close inside one bounded blocking invocation. Return: Exact owned result/errors, never replaced by post-commit cancellation.

pub init(Path: PathView)

pub init(Path: PathView)

Captures a borrowed path for whole-file UTF-8 text reading. Copies only the path view without opening a file, scheduling or validating native units. The parent task retains the backing loan through the worker's complete open/read/close/decode composition; moving this value does not retain that owner. Path: Native path view whose backing remains live through completion.

Invoke

pub readonly fn Invoke() -> Result<String, StreamReadError>

Runs open/stream-transfer/close inside one bounded blocking invocation. Return: Exact owned result/errors, never replaced by post-commit cancellation.

pub init(Path: PathView, Input: readonly byte[])

pub init(Path: PathView, Input: readonly byte[])

Captures borrowed path and byte views for a whole-file write. Copies only view descriptors without opening a file, scheduling or retaining either backing owner. The parent task retains both loans through the worker's complete open/write/close composition, including failure cleanup. Path: Native path view whose backing remains live through completion. Input: Readonly borrowed bytes kept live through transfer and file close.

Invoke

pub readonly fn Invoke() -> Result<void, FileWriteError>

Runs open/stream-transfer/close inside one bounded blocking invocation. Return: Exact owned result/errors, never replaced by post-commit cancellation.

Documentation snapshot: October 24, 2026 About versions ↗
Searching Development · language & standard library