From 65209217b5b68f56bc0bd5bc6c4dce33911ded59 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 20 Sep 2026 00:58:22 -0300 Subject: Add the file-server engine: cloud9.fs.Server(Backend, Options) The asynchronous 9P file-server engine from the Pardes editor moves into the library: fid table, walks, directory cursors, a job/slot model where backend replies arrive later by tag (status again = parked), Tflush cancellation and orphaned fids on hangup. Allocation-free, no OS calls, no std.Io; comptime Options (fid, slot, park data, name and user capacities) replace the editor's constants. Backend contract types (Req, Reply/ReplyWith, Op, Status, Attr, E, error strings) live here. 29 engine tests plus the client tests that sat beside it in Pardes. Co-Authored-By: Claude Fable 5.1 --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 79d044f..4c4d24c 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,14 @@ answer Tversion with `negotiate()`. Answer other requests with `reply()`. The backend implements its filesystem and fid lifecycle; cloud9 checks reply types, tags, counts, negotiated frame sizes, and flush completion. +`fs.Server(Backend, options)` is a file server on top of that session: it keeps +the fids, permissions, directory cursors, flush and hangup, and turns each 9P +request into backend operations (`fs.Req`: lookup, getattr, setattr, open, +read, write, release, readdir) that the backend answers by tag with `fs.Reply`, +at once or later; a read or write may park with `Status.again` and is retried. +Table sizes are comptime `fs.Options`; nothing allocates. See +[the engine's contract](docs/design.md#file-server-engine). + ## Programs Related programs live in `cloud9//`, one directory per program beside -- cgit v1.3