hydroperx-path

Crates.iohydroperx-path
lib.rshydroperx-path
version1.0.0
created_at2025-05-17 14:21:28.591446+00
updated_at2025-05-17 14:21:28.591446+00
descriptionWork with flexible file paths
homepage
repositoryhttps://github.com/hydroperx/path.rs
max_upload_size
id1677916
size42,243
Matheus Dias de Souza (hydroperx)

documentation

README

hydroperx::path

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 hydroperx_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"))
Commit count: 14

cargo fmt