Crates.io | omnipath |
lib.rs | omnipath |
version | 0.1.6 |
source | src |
created_at | 2022-09-27 16:20:11.054339 |
updated_at | 2023-05-12 19:13:30.00936 |
description | Path utility library |
homepage | |
repository | https://github.com/ChrisDenton/omnipath |
max_upload_size | |
id | 675061 |
size | 45,611 |
A path handling library for Rust. See the api docs!
The sys_absolute
function is similar to std::fs::canonicalize
but doesn't require accessing the filesystem.
// Normalizes the path and makes it absolute.
// On Windows platforms this will use `\` as the path separator.
let absolute = omnipath::sys_absolute("path/to/.//file".as_ref());
The sys_canonicalize
function is almost the same std::fs::canonicalize
except that it will try to return an non-verbatim path on Windows.
// On Windows this returns r"C:\path\to\file" instead of `\\?\C:\path\file`
let canonical = omnipath::sys_absolute(r"C:\path\to\file".as_ref());
The traits PosixPathExt and
WinPathExt provide platform
specific extension traits for std::path::Path
. For example, on Windows they allow converting
to a user path
(useful for displaying a path to the user without the \\?\
part)
or as a verbatim path