Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-anyfs-posix-governance FR-001
The codes a POSIX operation ends with, as a closed union: the fifteen a store can give cause for, each with the number Linux gives it and one sentence. A program that reads the code of an error (ENOENT, ESTALE) reads what a local file system would have said, so that what it does about it is the same on every store.
import { ERRNO_NUMBER, describeErrno } from "./errno.ts" ;
ERRNO_NUMBER .ENOENT ; // 2
describeErrno ("ESTALE" ); // "the object changed since it was read" Source: commons/anyfs-posix/src/governance/errno.ts
5 of 12 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.
governance.ERRNOSconst no test imports it const ERRNOS : readonly ["EACCES" , "EBADF" , "EEXIST" , "EFBIG" , "EINVAL" , "EIO" , "EISDIR" , "ENAMETOOLONG" , "ENOENT" , "ENOTDIR" , "ENOTEMPTY" , "ENOTSUP" , "EROFS" , "ESTALE" , "EXDEV" ]The codes, in the order of their names.
governance.Errnotype no test imports it type Errno = (typeof ERRNOS )[number ];governance.ERRNO_NUMBERconst no test imports it const ERRNO_NUMBER : Readonly <Record <"EACCES" | "EBADF" | "EEXIST" | "EFBIG" | "EINVAL" | "EIO" | "EISDIR" | "ENAMETOOLONG" | "ENOENT" | "ENOTDIR" | "ENOTEMPTY" | "ENOTSUP" | "EROFS" | "ESTALE" | "EXDEV" , number >>The number Linux gives each code: a registry with one entry for each code, which the compiler holds.
const ERRNO_SUMMARY : Readonly <Record <"EACCES" | "EBADF" | "EEXIST" | "EFBIG" | "EINVAL" | "EIO" | "EISDIR" | "ENAMETOOLONG" | "ENOENT" | "ENOTDIR" | "ENOTEMPTY" | "ENOTSUP" | "EROFS" | "ESTALE" | "EXDEV" , string >>What each code says, in a sentence.
governance.isErrnofunction no test imports it function isErrno (text : string ): text is "EACCES" | "EBADF" | "EEXIST" | "EFBIG" | "EINVAL" | "EIO" | "EISDIR" | "ENAMETOOLONG" | "ENOENT" | "ENOTDIR" | "ENOTEMPTY" | "ENOTSUP" | "EROFS" | "ESTALE" | "EXDEV" Whether a text is the name of a code.
governance.describeErrnofunction no test imports it function describeErrno (errno : "EACCES" | "EBADF" | "EEXIST" | "EFBIG" | "EINVAL" | "EIO" | "EISDIR" | "ENAMETOOLONG" | "ENOENT" | "ENOTDIR" | "ENOTEMPTY" | "ENOTSUP" | "EROFS" | "ESTALE" | "EXDEV" ): string A code in a few words: its name and what it says.
const ERRNOS : readonly ["EACCES" , "EBADF" , "EEXIST" , "EFBIG" , "EINVAL" , "EIO" , "EISDIR" , "ENAMETOOLONG" , "ENOENT" , "ENOTDIR" , "ENOTEMPTY" , "ENOTSUP" , "EROFS" , "ESTALE" , "EXDEV" ]The codes, in the order of their names.
Imported by 15 tests of the run (15 passed, 0 failed): the library's results
Errnotype no test imports it type Errno = (typeof ERRNOS )[number ];const ERRNO_NUMBER : Readonly <Record <"EACCES" | "EBADF" | "EEXIST" | "EFBIG" | "EINVAL" | "EIO" | "EISDIR" | "ENAMETOOLONG" | "ENOENT" | "ENOTDIR" | "ENOTEMPTY" | "ENOTSUP" | "EROFS" | "ESTALE" | "EXDEV" , number >>The number Linux gives each code: a registry with one entry for each code, which the compiler holds.
Imported by 8 tests of the run (8 passed, 0 failed): the library's results
const ERRNO_SUMMARY : Readonly <Record <"EACCES" | "EBADF" | "EEXIST" | "EFBIG" | "EINVAL" | "EIO" | "EISDIR" | "ENAMETOOLONG" | "ENOENT" | "ENOTDIR" | "ENOTEMPTY" | "ENOTSUP" | "EROFS" | "ESTALE" | "EXDEV" , string >>What each code says, in a sentence.
Imported by 8 tests of the run (8 passed, 0 failed): the library's results
function isErrno (text : string ): text is "EACCES" | "EBADF" | "EEXIST" | "EFBIG" | "EINVAL" | "EIO" | "EISDIR" | "ENAMETOOLONG" | "ENOENT" | "ENOTDIR" | "ENOTEMPTY" | "ENOTSUP" | "EROFS" | "ESTALE" | "EXDEV" Whether a text is the name of a code.
Imported by 8 tests of the run (8 passed, 0 failed): the library's results
function describeErrno (errno : "EACCES" | "EBADF" | "EEXIST" | "EFBIG" | "EINVAL" | "EIO" | "EISDIR" | "ENAMETOOLONG" | "ENOENT" | "ENOTDIR" | "ENOTEMPTY" | "ENOTSUP" | "EROFS" | "ESTALE" | "EXDEV" ): string A code in a few words: its name and what it says.
Imported by 8 tests of the run (8 passed, 0 failed): the library's results