6 stable releases

1.2.1 Mar 1, 2025
1.1.1 Feb 22, 2025
1.0.1 Feb 21, 2025
1.0.0 Feb 19, 2025

#513 in Filesystem

Download history 275/week @ 2025-02-16 218/week @ 2025-02-23 160/week @ 2025-03-02 6/week @ 2025-03-09

293 downloads per month
Used in 2 crates (via mxmlextrema-as3parser)

ISC license

28KB
395 lines

File Paths

Work with textual file paths, including relativity and resolution. Features:

  • Variant: FlexPath methods consider absolute paths according to the path's FlexPathVariant. Two variants are supported: Common and Windows. The native variant can be deduced directly through _native suffixed methods.
  • Normalization: normalize paths with the normalize_path() function, whether they exist or not (does not solve for symlinks and real letter case).

Requirements:

  • The Rust standard library (std).

Example

use realhydroper_path::FlexPath;

assert_eq!("a", FlexPath::new_common("a/b").resolve("..").to_string());
assert_eq!("a", FlexPath::new_common("a/b/..").to_string());
assert_eq!("a/b/c/d/e", FlexPath::from_n_common(["a/b", "c/d", "e/f", ".."]).to_string());
assert_eq!("../../c/d", FlexPath::new_common("/a/b").relative("/c/d"))

Dependencies

~2.4–4MB
~70K SLoC