Expand description
Path validation and utility functions
Functions§
- create_
validated_ pathbuf - Creates a PathBuf from a string after
validate_path_str. - is_
just_ filename - Checks if a path looks like a filename (no directory components)
- is_
symlink_ dir - True when the path itself is a symlink (callers use it on symlinked dirs).
- relative_
path_ from_ dir - Compute a relative path from
from_dirtoto. - safe_
parent_ for_ creation - Safely gets the parent directory for creating directories. Returns None for paths that don’t need directory creation (like “config.yaml” in current dir)
- validate_
path_ segment - Validates that a string is safe to use as a single path segment (e.g. an id or file stem).
- validate_
path_ str - Validates that a path string is non-empty and does not contain unsafe components.