Skip to main content

Module files_root

Module files_root 

Source
Expand description

A Files pane confined to one folder: a container agent’s folder, shown to the person.

A container agent’s /workspace is a folder of the host that the agent can change while a window reads it, so a link or junction it swaps in later could make a Files pane show the person’s own files, which the agent could then read back from a screenshot of the pane. So such a pane carries files:root, the canonical host folder it was opened on, and srv checks it on the requests the pane makes that name it (the listing, the watch, the preview stream, opening in the Editor, and the changes): the path is resolved again at each access, links and junctions included, and refused unless it lies inside the root. The pane lists, navigates, previews and opens files in the Editor; it changes nothing.

Constants§

FILES_ROOT_META_KEY 🔒
The block meta key that confines a Files pane. Written when the pane is opened; a client may not write it.
NO_PROGRAMS 🔒
The refusal for handing a file to another program from a confined pane.
READ_ONLY 🔒
The refusal for a change asked of a confined pane.

Functions§

bind_pane_open 🔒
pane.open from a confined pane: only a file inside its folder, opened in an Editor. Its path is replaced by the resolved one, and the answer is the pane’s folder (none: the open is from no such pane).
bound_path 🔒
path as the pane block_id may use it: for a confined pane, resolved now and inside its root (else the reason); for any other, as asked.
confine 🔒
path as it is now (links and junctions resolved), if it lies inside root.
confined_meta 🔒
The meta of a Files pane confined to folder (resolved), which the pane’s title calls of.
is_confined 🔒
Whether block_id is a pane confined to a folder.
outside_listing 🔒
A listing that failed because the folder lies outside the pane’s root.
refuse_change 🔒
Refuses a change from the pane block_id when it is confined.
root_of 🔒
The folder block_id’s Files pane is confined to, if it is.