IF Commons GitHub

logical/errno-table

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-anyfs-posix-logical FR-003

What a store's problem is, as a code of POSIX: a total table from the five kinds of problem (and the seven reasons of a refusal) to the code a local file system would have given. Where the same problem means two things the operation decides: a write that expected no object and found one is EEXIST where it made a file and ESTALE where it was to replace what it had read.

import { errnoOf } from "./errno-table.ts";
import { missing, parsePath } from "@intellectual-frontiers/anyfs/governance";
const p = parsePath("a");
p.kind === "ok" && errnoOf(missing(p.value), { op: "read-all" }); // "ENOENT"

Source: commons/anyfs-posix/src/logical/errno-table.ts

1 of 4 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

logical.Contexttypeno test imports it
type Context = { readonly op: PlanOp; readonly creating?: boolean };

What the operation was doing when the store said it: the operation, and whether it was making an object where there was none.

logical.errnoOffunctionno test imports it
function errnoOf(problem: Problem, context: Context): "EACCES" | "EBADF" | "EEXIST" | "EFBIG" | "EINVAL" | "EIO" | "EISDIR" | "ENAMETOOLONG" | "ENOENT" | "ENOTDIR" | "ENOTEMPTY" | "ENOTSUP" | "EROFS" | "ESTALE" | "EXDEV"

The code of a problem.

Contexttypeno test imports it
type Context = { readonly op: PlanOp; readonly creating?: boolean };

What the operation was doing when the store said it: the operation, and whether it was making an object where there was none.

errnoOffunction
function errnoOf(problem: Problem, context: Context): "EACCES" | "EBADF" | "EEXIST" | "EFBIG" | "EINVAL" | "EIO" | "EISDIR" | "ENAMETOOLONG" | "ENOENT" | "ENOTDIR" | "ENOTEMPTY" | "ENOTSUP" | "EROFS" | "ESTALE" | "EXDEV"

The code of a problem.

Imported by 7 tests of the run (7 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.