Skip to main content

normalize_lexically

Function normalize_lexically 

Source
pub fn normalize_lexically(path: &Path) -> PathBuf
Expand description

Resolve . and .. textually, the way cd -L does for the logical $PWD.

No filesystem access: /a/link/.. is /a, whatever link points to. .. at the root stays at the root. A relative path keeps the leading .. components it cannot cancel, and an empty result is ".".