Skip to main content

Module pathutil

Module pathutil 

Source

Functionsยง

safe_canonicalize
Canonicalize a path and strip the Windows verbatim/extended-length prefix (\\?\) that std::fs::canonicalize adds on Windows. This prefix breaks many tools and string-based path comparisons.
safe_canonicalize_or_self
Like safe_canonicalize but returns the original path on failure.
strip_verbatim
Remove the \\?\ / //?/ verbatim prefix from a PathBuf. Handles both regular verbatim (\\?\C:\...) and UNC verbatim (\\?\UNC\...).
strip_verbatim_str
Remove the \\?\ / //?/ verbatim prefix from a path string. Returns Some(cleaned) if a prefix was found, None otherwise.