Expand description
Path validation and utility functions
Functions§
- create_
validated_ pathbuf - Creates a PathBuf from a string, validating it’s not empty or whitespace
- is_
just_ filename - Checks if a path looks like a filename (no directory components)
- 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 not empty or just whitespace