Crates.io | pathbuftools |
lib.rs | pathbuftools |
version | 0.1.2 |
source | src |
created_at | 2019-04-20 16:13:12.82411 |
updated_at | 2019-05-14 13:51:18.264495 |
description | Additional helper methods for PathBuf |
homepage | https://github.com/rabite0/pathbuftools |
repository | https://github.com/rabite0/pathbuftools |
max_upload_size | |
id | 129111 |
size | 4,734 |
pathbuftools is a small library that adds some helper methods which are useful when working with PathBufs.
This mostly usefuly when you're doing low-level stuff with files. I factored this library out of , so for the most part it contains stuff I needed there, plus a bit more I stopped using.
Available methods and their singatures are:
fn short_path(&self) -> PathBuf;
fn short_string(&self) -> String;
fn name_starts_with(&self, pat: &str) -> bool;
fn quoted_file_name(&self) -> Option<OsString>;
fn quoted_path(&self) -> OsString;
NOTE: short_path() removes the $HOME component of a Path and replaces it with ~, so "/home/foo/bar" becomes "~/bar".