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

FileBlockingWork

Captures borrowed path backing and copied selection arguments.

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, Mode: FileOpenMode, Links: LinkPolicy)

pub init(Path: PathView, Mode: FileOpenMode, Links: LinkPolicy)

Captures borrowed path backing and copied selection arguments. Path: View loaned through worker completion. Mode: Copied data access/creation policy. Links: Copied final-component selection policy.

Invoke

pub readonly fn Invoke() -> Result<usize, IoError>

Executes one safe platform operation; never retains any byte/path pointer. Return: Exact native result, without post-commit cancellation substitution.

pub init(Token: usize, Output: mut byte[])

pub init(Token: usize, Output: mut byte[])

Captures one read's file token and borrowed writable destination. Copies the token and slice descriptor without scheduling, I/O or acquiring another file owner. The parent task retains the file and output-buffer loan through worker completion; moving this work value transfers no backing owner. Token: Held-file token copied from the parent operation's live owner. Output: Writable borrowed bytes kept live and available through completion.

Invoke

pub readonly fn Invoke() -> Result<usize, IoError>

Executes one safe platform operation; never retains any byte/path pointer. Return: Exact native result, without post-commit cancellation substitution.

pub init(Token: usize, Input: readonly byte[])

pub init(Token: usize, Input: readonly byte[])

Captures one write's file token and borrowed readonly source. Copies the token and slice descriptor without scheduling, I/O or acquiring another file owner. The parent task retains the file and input-buffer loan through worker completion; moving this work value transfers no backing owner. Token: Held-file token copied from the parent operation's live owner. Input: Readonly borrowed bytes whose backing remains live through completion.

Invoke

pub readonly fn Invoke() -> Result<usize, IoError>

Executes one safe platform operation; never retains any byte/path pointer. Return: Exact native result, without post-commit cancellation substitution.

Create

pub static fn Create(Token: usize) -> FileSynchronizeWork

Creates copied handoff arguments without scheduling or I/O. Token: Authenticated held-object token borrowed through the parent task. Return: Independent Data arguments; the parent retains the original token owner.

Invoke

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

Executes one safe platform operation; never retains any byte/path pointer. Return: Exact native result, without post-commit cancellation substitution.

Create

pub static fn Create(Token: usize, Offset: i64, Origin: SeekOrigin) -> FileSeekWork

Creates copied handoff arguments without scheduling or I/O. Token: Authenticated held-object token borrowed through the parent task. Offset: Signed byte offset interpreted relative to Origin. Origin: Declared byte-position origin for the requested seek. Return: Independent Data arguments; the parent retains the original token owner.

Invoke

pub readonly fn Invoke() -> Result<u64, IoError>

Executes one safe platform operation; never retains any byte/path pointer. Return: Exact native result, without post-commit cancellation substitution.

Create

pub static fn Create(Token: usize) -> FileReadMetadataWork

Creates copied handoff arguments without scheduling or I/O. Token: Authenticated held-object token borrowed through the parent task. Return: Independent Data arguments; the parent retains the original token owner.

Invoke

pub readonly fn Invoke() -> Result<FileMetadata, IoError>

Executes one safe platform operation; never retains any byte/path pointer. Return: Exact native result, without post-commit cancellation substitution.

Create

pub static fn Create(Token: usize) -> FileCloseWork

Creates copied handoff arguments without scheduling or I/O. Token: Authenticated held-object token borrowed through the parent task. Return: Independent Data arguments; the parent retains the original token owner.

Invoke

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

Executes one safe platform operation; never retains any byte/path pointer. Return: Exact native result, without post-commit cancellation substitution.

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