Function uu_cp::localize_to_target[][src]

pub fn localize_to_target(
    root: &Path,
    source: &Path,
    target: &Path
) -> CopyResult<PathBuf>

Remove the root prefix from source and prefix it with target to create a file that is local to target

Examples

assert!(uu_cp::localize_to_target(
    &Path::new("a/source/"),
    &Path::new("a/source/c.txt"),
    &Path::new("target/"),
).unwrap() == Path::new("target/c.txt"))