Skip to main content

Module path

Module path 

Source
Expand description

Root-relative path handling.

Every path a tool receives is checked here before it reaches the filesystem: absolute paths and any .. component are refused with a clear message. This is the friendly first line; the real confinement is cap_std::fs::Dir, which refuses anything (including symlinks) that resolves outside the root even if this check were bypassed.

Functionsยง

display
Root-relative path as shown to the model: / separators on every platform.
for_dir
The path to hand to cap_std::fs::Dir: . for the root, the relative path otherwise.
relative
Turn a tool-supplied path into a clean path relative to the root folder.
relative_entry
Like relative, but the root itself is refused: for tools that act on one entry (read, write, move).