file_paths

Crates.iofile_paths
lib.rsfile_paths
version1.0.0
sourcesrc
created_at2023-08-05 16:17:06.542727
updated_at2023-10-22 15:00:10.512071
descriptionWork with flexible file paths
homepage
repositoryhttps://github.com/hydroper/rust_file_paths
max_upload_size
id936532
size23,856
Matheus Dias de Souza (hydroper)

documentation

README

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.

Requirements:

  • The Rust standard library (std).

Example

use file_paths::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: 7

cargo fmt