Function omnipath::sys_absolute
source · pub fn sys_absolute(path: &Path) -> Result<PathBuf>
Expand description
Converts a path to absolute according to the rules of the current platform.
Unlike std::fs::canonicalize
this does not resolve symlinks.
Example
use omnipath::sys_absolute;
use std::path::Path;
use std::env::current_dir;
let path = Path::new(r"path/to/.//file");
assert_eq!(
sys_absolute(path).unwrap(),
// WARNING: This may not always be equal depending on the current
// directory and OS.
current_dir().unwrap().join("path/to/file")
);