governance.FileTypetypeno test imports ittype FileType = "file" | "dir";What a name is: a file (an object) or a directory (a prefix).
What the operations of the view are given and give back: the kind of a name, what a stat says, an entry of a directory, the modes an object is opened in, the number of an open object and what an operation ends with. A result is a Result of an outcome (the value, how it was carried out, and what the operation noticed on the way) or of an error with a code, one sentence and how the operation would have been carried out, so that nothing a program reads is a guess.
import { openFlags } from "./types.ts";
openFlags("a").append; // truegovernance.FileTypetypeno test imports ittype FileType = "file" | "dir";What a name is: a file (an object) or a directory (a prefix).
governance.PosixStattypeno test imports ittype PosixStat = {
readonly type: FileType;
readonly size: number;
readonly mode: number;
readonly uid: number;
readonly gid: number;
readonly mtime?: string;
readonly rev?: Revision;
};What a stat says. A file has the size and the revision of its object and the time the store gives; a directory has no size.
governance.DirEntrytypeno test imports ittype DirEntry = { readonly name: string; readonly type: FileType; readonly size?: number; readonly rev?: Revision; readonly mtime?: string };One name in a directory. A file has its size, its revision and its time.
governance.OPEN_MODESconstno test imports itconst OPEN_MODES: readonly ["r", "r+", "w", "w+", "wx", "a", "a+"]The modes an object is opened in, as a file system names them: read, read and write, make and write, make and read and write, make where none is, add to the end, and add to the end and read.
governance.OpenModetypeno test imports ittype OpenMode = (typeof OPEN_MODES)[number];One mode.
governance.OpenFlagstypeno test imports ittype OpenFlags = { readonly read: boolean; readonly write: boolean; readonly create: boolean; readonly exclusive: boolean; readonly truncate: boolean; readonly append: boolean };What a mode means, as flags.
governance.openFlagsfunctionno test imports itfunction openFlags(mode: "a" | "a+" | "r" | "r+" | "w" | "w+" | "wx"): OpenFlagsThe flags of a mode.
governance.Fdtypeno test imports ittype Fd = Brand<number, "anyfs posix fd">;The number of an open object. Made only by the table of handles.
governance.PartialReporttypeno test imports ittype PartialReport = { readonly done: readonly PosixPath[]; readonly failed: readonly { readonly path: PosixPath; readonly errno: Errno }[] };What a walk over many objects did: those it did and those it could not.
governance.PosixErrortypeno test imports ittype PosixError = {
readonly errno: Errno;
readonly message: string;
readonly path?: PosixPath;
/** How the operation would have been carried out. */
readonly fidelity: Fidelity;
/** What the store said, where it said it. */
readonly problem?: Problem;
/** What a walk did before it failed, where it was one. */
readonly report?: PartialReport;
};What an operation ends with where it did not do what it was asked.
governance.Outcometypeno test imports ittype Outcome<T> = { readonly value: T; readonly fidelity: Fidelity; readonly notes: readonly string[] };What an operation did: its value, how it was carried out, and what it noticed on the way.
governance.Donetypeno test imports ittype Done<T> = Promise<Result<Outcome<T>, PosixError>>;What every operation of the view ends with.
governance.Countedtypeno test imports ittype Counted = { readonly count: number };What a directory that was removed or a walk that was run says it did.
governance.Locatedtypeno test imports ittype Located = { readonly path: Path; readonly shown: PosixPath };A key and the path it is shown at, for a walk.
FileTypetypeno test imports ittype FileType = "file" | "dir";What a name is: a file (an object) or a directory (a prefix).
PosixStattypeno test imports ittype PosixStat = {
readonly type: FileType;
readonly size: number;
readonly mode: number;
readonly uid: number;
readonly gid: number;
readonly mtime?: string;
readonly rev?: Revision;
};What a stat says. A file has the size and the revision of its object and the time the store gives; a directory has no size.
DirEntrytypeno test imports ittype DirEntry = { readonly name: string; readonly type: FileType; readonly size?: number; readonly rev?: Revision; readonly mtime?: string };One name in a directory. A file has its size, its revision and its time.
OPEN_MODESconstconst OPEN_MODES: readonly ["r", "r+", "w", "w+", "wx", "a", "a+"]The modes an object is opened in, as a file system names them: read, read and write, make and write, make and read and write, make where none is, add to the end, and add to the end and read.
OpenModetypeno test imports ittype OpenMode = (typeof OPEN_MODES)[number];One mode.
OpenFlagstypeno test imports ittype OpenFlags = { readonly read: boolean; readonly write: boolean; readonly create: boolean; readonly exclusive: boolean; readonly truncate: boolean; readonly append: boolean };What a mode means, as flags.
openFlagsfunctionfunction openFlags(mode: "a" | "a+" | "r" | "r+" | "w" | "w+" | "wx"): OpenFlagsThe flags of a mode.
Fdtypeno test imports ittype Fd = Brand<number, "anyfs posix fd">;The number of an open object. Made only by the table of handles.
PartialReporttypeno test imports ittype PartialReport = { readonly done: readonly PosixPath[]; readonly failed: readonly { readonly path: PosixPath; readonly errno: Errno }[] };What a walk over many objects did: those it did and those it could not.
PosixErrortypeno test imports ittype PosixError = {
readonly errno: Errno;
readonly message: string;
readonly path?: PosixPath;
/** How the operation would have been carried out. */
readonly fidelity: Fidelity;
/** What the store said, where it said it. */
readonly problem?: Problem;
/** What a walk did before it failed, where it was one. */
readonly report?: PartialReport;
};What an operation ends with where it did not do what it was asked.
Outcometypeno test imports ittype Outcome<T> = { readonly value: T; readonly fidelity: Fidelity; readonly notes: readonly string[] };What an operation did: its value, how it was carried out, and what it noticed on the way.
Donetypeno test imports ittype Done<T> = Promise<Result<Outcome<T>, PosixError>>;What every operation of the view ends with.
Countedtypeno test imports ittype Counted = { readonly count: number };What a directory that was removed or a walk that was run says it did.
Locatedtypeno test imports ittype Located = { readonly path: Path; readonly shown: PosixPath };A key and the path it is shown at, for a walk.