Expand description
Safe path helpers. Safe path helpers.
Enums§
- Safe
Path Error - Error returned when a relative path escapes its expected root.
Functions§
- absolute
- Return an absolute path without requiring the path to exist.
- canonicalize
- Canonicalize a path by resolving symlinks and normalizing components.
- confine_
existing_ path - Canonicalize an existing
pathand reject it when it resolves outsideroot. - confine_
path - Resolve
pathunderrootand reject escapes, allowing the final path to be missing. - parent_
dir - Return the non-empty parent directory for
path. - resolve_
root_ relative_ to - Resolve
rootagainst a base directory when relative, then canonicalize it. - safe_
join - Join a caller-owned root with a validated relative path.
- validate_
relative_ path - Validate that
pathis safe to join under a caller-owned root directory.