Skip to main content

canonicalize_under

Function canonicalize_under 

Source
pub fn canonicalize_under(base: &Path, path: &Path) -> Result<PathBuf>
Expand description

Resolve path against base (via resolve_under) and then canonicalize it on disk, resolving symlinks to their real path. Fails if the path does not exist. Use this only when a tool needs a real, existence-checked path (e.g. a security/scope decision or distinguishing a file from a directory); prefer resolve_under for write/patch targets that may not exist yet.