| Crates.io | file_paths |
| lib.rs | file_paths |
| version | 1.0.0 |
| created_at | 2023-08-05 16:17:06.542727+00 |
| updated_at | 2023-10-22 15:00:10.512071+00 |
| description | Work with flexible file paths |
| homepage | |
| repository | https://github.com/hydroper/rust_file_paths |
| max_upload_size | |
| id | 936532 |
| size | 23,856 |
Work with textual file paths, including relativity and resolution. Features:
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:
std).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"))