Skip to main content

Module file

Module file 

Source
Expand description

What a path names, and the container doors that take one. The one module here that is still native by nature: a browser has no filesystem to point at, and reaches its containers by name instead. What a path names: whether it is a diagram, and where one is saved or renamed to. A diagram is a container, which is a directory.

Native only — the browser has no filesystem to open a container from.

Everything here is a plain function over paths, so the flow is testable without a dialog; the pickers that deliver a path live in the shell.

Enums§

ArchiveFailure
Why an archive did not open.

Functions§

as_container_path
A picked save location as a container path. The suffix is the format’s name, so a path without one gets it — appended rather than substituted, since a document called notes.v2 should not become notes.bwx.
container_name
What the chrome calls an open container: the directory’s own name.
create_container
Lay out a container at root holding commits — how a scratch session becomes durable, since a scratch session has no manifest to copy.
names_a_container
Whether path names a container rather than a plain file. The extension is the fast answer; the manifest inside is the true one, so a container someone renamed is still opened as one.
names_an_archive
Whether path names a packed container, the .bwx.zip a container travels as.
open_archive
Lay the archive at archive down as the container it carries, beside it, and open that — engine.bwx.zip becomes engine.bwx in the same folder. A container the store cannot open is not one that arrived, so the half-laid directory is removed rather than left standing.
open_container
Open the container at root.
refused_as_a_diagram
Why a picked folder is not a diagram, or None where it is one.
renamed_beside
Where the container at root stands once its document is renamed to to: the same directory, a new name. What the recent list is told, after the store has done the renaming.
save_container_through
Save the container at source as it stood at at, into a new one at root — Save-as, and how a session that already has a manifest makes another. The lines are copied rather than re-authored, so everything the records carry comes with them.