#unix #linux #filename #path #pathbuf

pathbuftools

Additional helper methods for PathBuf

2 releases

✓ Uses Rust 2018 edition

0.1.2 May 14, 2019
0.1.1 Apr 20, 2019

#97 in Filesystem

Download history 25/week @ 2019-04-19 76/week @ 2019-04-26 188/week @ 2019-05-03 43/week @ 2019-05-10 72/week @ 2019-05-17 37/week @ 2019-05-24 40/week @ 2019-05-31 43/week @ 2019-06-07 64/week @ 2019-06-14 53/week @ 2019-06-21 22/week @ 2019-06-28 159/week @ 2019-07-05

160 downloads per month
Used in 1 crate

WTFPL license

4KB
61 lines

pathtbuftools

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 hunter, 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".

Dependencies

~688KB