summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 00:48:48 -0300
committerGabriel Schneider <[email protected]>2026-11-17 10:06:26 -0300
commitb44d970c121a65e1f9de04fee600a3b495fb6c96 (patch)
treedf992c4dbbffb6f27f2e3cabf73dc634f4a58dc6 /README.md
parent67fa2a1f2e6057bbce7441a16ebab84848f623ae (diff)
downloadcloud9-b44d970c121a65e1f9de04fee600a3b495fb6c96.tar.gz
cloud9-b44d970c121a65e1f9de04fee600a3b495fb6c96.zip
verbs: the fs verbs as a function a program calls with a dialled tree
The user wants each app's binary to drive the tree it serves ("the cli should be like a living documentation, similar to 9p"): `pardes fs read pane/3/body`, `drat-meout fs read state/scene`. verbs.run(&fsys, args, stdin, stdout, stderr) is that command line, added in five lines (the top of the file shows them): ls, read, write (the words and a newline, or stdin a write a read of it, as 9p write), ask (write then read one open), follow (ask, or read: each answer flushed as it comes), stat (Plan 9's mode letters, length, uid, gid, mtime, name), help and complete. Exit status 0, or 1 with the server's own words on stderr; a verb not known is the usage. help PATH reads the tree's /README: a line is about the file its first word names, a path from the root with a leading or trailing slash or a comma dropped and <anything> standing for one name, and about everything under it; lines after it indented deeper go with it. pardes's src/fs-help.txt, 9proc's and 9agents' READMEs are in that shape already; sketchbook's control tree serves none yet and would write one so. complete PREFIX lists the directory PREFIX ends in, the names it starts, as paths, a trailing slash on a directory. Tests drive run() against TestTree in process: listings, reads, stats, completion, refusals in the server's words, stdin writes, ask, help including the line matcher on pardes's and 9proc's shapes, follow of three held chunks and a hangup mid-read, and the usage. Also run by hand from a scratch program of those five lines against a 9proc-demo on a Unix socket.
Diffstat (limited to 'README.md')
-rw-r--r--README.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/README.md b/README.md
index a474147..73efa3e 100644
--- a/README.md
+++ b/README.md
@@ -80,6 +80,14 @@ the common shapes, streaming into a `std.Io.Writer`. A refusal is
`error.Refused` and `said()` holds the server's words. Its buffers are in the
struct: no allocator.
+`verbs.run(&fsys, args, stdin, stdout, stderr)` makes a program's own binary
+the command line of the tree it dialled: `ls`, `read`, `write`, `ask`,
+`follow`, `stat`, `help PATH` (the lines of the tree's `/README` whose first
+word names PATH, a path over it or one under it, `<n>` standing for any name,
+with the lines indented under them) and `complete PREFIX` (a directory listing, a path
+a line, for shell completion). Exit status 0, or 1 with the server's words on
+stderr. See the top of `src/verbs.zig` for the five lines a program adds.
+
For a server, call `Server.receive()` after `push()`. A request borrows the input
until `release()`. After releasing backend fids and canceling outstanding work,
answer Tversion with `negotiate()`. Answer other requests with `reply()`. The