Skip to main content

contain_within

Function contain_within 

Source
pub fn contain_within(
    base: &Path,
    relative: &Path,
) -> Result<PathBuf, BuildError>
Expand description

Resolve relative against base and require the canonicalized result to stay inside canonicalized base.

ยงErrors

  • BuildError::Io when either canonicalization fails (missing file, permission) or when the resolved path escapes base (symlink traversal).