physical.posixfunctionno test imports itfunction posix(store: Store<Viewable>, options?: PosixOptions): PosixThe view of a store as a file system, with the policy, the working directory and the table of handles the program gives.
The view of a store as a file system. posix(store) makes a Posix that carries out each operation by the plan the logical layer gives it for the capabilities of the store, and every result carries the fidelity of that plan. Directories are read from lists, an object is written through a buffer that is put at close, a rename is the store's where it has one and a copy and a delete where it has not, and what a store cannot do is refused with a code and a reason. Nothing is kept in the process but the three values the program passed: the policy, the working directory and the handles.
import { memoryStore } from "@intellectual-frontiers/anyfs/memory";
import { posix } from "./posix.ts";
const view = posix(memoryStore({ name: "scratch" }));
await view.writeFile("/fleet/olympia.json", new TextEncoder().encode("{}"));
const listing = await view.readdir("/fleet"); // [{ name: "olympia.json", type: "file", size: 2, ... }]physical.posixfunctionno test imports itfunction posix(store: Store<Viewable>, options?: PosixOptions): PosixThe view of a store as a file system, with the policy, the working directory and the table of handles the program gives.
physical.Viewabletypeno test imports ittype Viewable = "read" | "list" | "stat";The capabilities a store must have to be viewed as a file system: the three that read. What it can write is read from its capabilities, and a view of a store that cannot be written refuses what would change it.
posixfunctionfunction posix(store: Store<Viewable>, options?: PosixOptions): PosixThe view of a store as a file system, with the policy, the working directory and the table of handles the program gives.
Viewabletypeno test imports ittype Viewable = "read" | "list" | "stat";The capabilities a store must have to be viewed as a file system: the three that read. What it can write is read from its capabilities, and a view of a store that cannot be written refuses what would change it.