Skip to main content

Module container_pane_snapshot

Module container_pane_snapshot 

Source
Expand description

pane.open from a container agent: a read-only snapshot of a file in its workspace.

The pane is drawn by a window on the host, and a window reads whatever host path its pane is given, as the user. A container agent’s /workspace is a folder of the host the agent can change while a window reads it, so handing the window a path in it would let a link swapped in later show the user’s own files in a pane the agent asked for. So the window is never given a path in the workspace: srv reads the file out of it without following a link, keeps a read-only copy in a folder of its own, and opens the pane on the copy. The pane’s title says what it is (the container path and the time), the answer tells the agent to open it again to refresh, and the copy goes when its pane closes (and any left over, when srv starts).

The views that show no path (sysinfo, help, tower) open as they are. A terminal runs on the host, another machine is reached as the user and a browser has its own tool; each is refused with the way on. A folder can’t be a snapshot: it opens as a Files pane confined to it (files_root.rs), which lists and navigates and changes nothing.

Structs§

Snapshot 🔒
A snapshot taken for a pane that is about to open.

Constants§

EDITOR_LIMIT 🔒
The editor reads no more than this itself.
MARKER 🔒
Names the pane a snapshot’s folder belongs to.
MAX_SNAPSHOTS 🔒
Snapshots on disk at once.
MEDIA_LIMIT 🔒
A picture or recording to look at.

Functions§

container_path 🔒
real as the container names it: /workspace/....
folder_pane 🔒
A folder of the agent’s workspace as a Files pane confined to it: the pane is given the folder’s canonical host path and carries it as files:root, which srv checks, resolved again, on every listing the pane asks for.
for_person 🔒
A file of a container agent’s folder for a pane the person asked for: cmd is turned to open a read-only copy of file, which lies in the folder within (both resolved), kept under root. of is what the pane calls it. The person may open a picture or a recording this way, so the larger limit holds.
forget 🔒
The snapshot kept for block_id’s pane goes with it. One not yet noted to a pane is a pane still opening: left alone.
open_for 🔒
For a container agent’s pane.open: prepare under srv’s snapshot folder.
prepare 🔒
Check a container agent’s pane.open and, for a file, take its snapshot under root. Returns the request to open, with nothing the caller set beyond the checked fields, and the snapshot if there is one.
remove_snapshot 🔒
Removes a snapshot’s folder. Its copy is read-only, which Windows won’t delete until that is cleared.
remove_where 🔒
Removes every snapshot under root whose pane gone says is gone, given the pane it was noted to (none: not noted).
root 🔒
Where the copies are kept.
spawn_sweeper 🔒
Removes a snapshot when its pane (or the tab or workspace holding it) is deleted.
sweep 🔒
When srv starts, nothing is opening: copies whose pane is no longer there, or was never noted, are removed.
take 🔒
A read-only copy of file, which lies in the folder within (both resolved), in a folder of its own under root: at most limit bytes. of is what its pane calls it. Returns the copy’s path.