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

#175 in Filesystem

Download history 1860/week @ 2024-03-14 2181/week @ 2024-03-21 2000/week @ 2024-03-28 2445/week @ 2024-04-04 2433/week @ 2024-04-11 1966/week @ 2024-04-18 2081/week @ 2024-04-25 2270/week @ 2024-05-02 2013/week @ 2024-05-09 1979/week @ 2024-05-16 1605/week @ 2024-05-23 1557/week @ 2024-05-30 1360/week @ 2024-06-06 1283/week @ 2024-06-13 1665/week @ 2024-06-20 1254/week @ 2024-06-27

5,796 downloads per month
Used in 67 crates (via nu-path)

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