8 releases

0.1.6 May 12, 2023
0.1.5 Mar 25, 2023
0.1.1 Oct 20, 2022
0.0.0 Sep 27, 2022

#190 in Filesystem

Download history 1755/week @ 2024-07-21 1676/week @ 2024-07-28 1238/week @ 2024-08-04 1257/week @ 2024-08-11 2292/week @ 2024-08-18 2301/week @ 2024-08-25 2357/week @ 2024-09-01 2107/week @ 2024-09-08 2110/week @ 2024-09-15 2139/week @ 2024-09-22 2440/week @ 2024-09-29 1966/week @ 2024-10-06 2570/week @ 2024-10-13 2238/week @ 2024-10-20 1893/week @ 2024-10-27 1751/week @ 2024-11-03

8,690 downloads per month
Used in 94 crates (2 directly)

MIT/Apache

46KB
797 lines

A path handling library for Rust. See the api docs!

Quick tour

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());

Platform-specific functions

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

No runtime deps

Features