pub fn canonicalize_using_cwd<'a>(
cwd_opt: Option<&str>,
path: &'a str,
) -> Option<String>Expand description
Make a relative path absolute using an optional current working directory.
Given a cwd of “/scheme/scheme_name/dir_name”, this function will turn path “foo” into /scheme/scheme_name/dir_name/foo“. “/foo” will be left as is, because it is already absolute. “.” and empty segments “//” will be removed. “..” will be resolved by backing up one directory, except at the root, where “..” will be ignored and removed.
For old format schemes, given a cwd of “scheme:/path”, this function will turn “foo” into “scheme:/path/foo”. “/foo” will turn into “file:/foo”. “bar:/foo” will be used directly, as it is already absolute.