5 releases

0.2.0 Dec 26, 2024
0.1.3 Dec 26, 2024
0.1.2 May 6, 2022
0.1.1 Aug 3, 2018
0.1.0 Aug 2, 2018

#234 in Filesystem

Download history 13004/week @ 2025-03-09 14136/week @ 2025-03-16 12621/week @ 2025-03-23 14037/week @ 2025-03-30 13248/week @ 2025-04-06 9636/week @ 2025-04-13 10870/week @ 2025-04-20 11009/week @ 2025-04-27 10247/week @ 2025-05-04 12702/week @ 2025-05-11 12749/week @ 2025-05-18 11503/week @ 2025-05-25 12358/week @ 2025-06-01 10948/week @ 2025-06-08 11659/week @ 2025-06-15 12244/week @ 2025-06-22

47,825 downloads per month
Used in 24 crates (19 directly)

Apache-2.0/MIT

8KB
93 lines

filepath

filepath contains an extension trait for std::fs::File providing a path method.


filepath

Get the filesystem path of a file.

A simple extension trait for File that provides a single method path, which returns the path of a file.

Note: Not every file has a path. The path might be wrong for example after moving a file.

OS support: Linux, Mac, Windows and iOS

use std::fs::File;
use filepath::FilePath;

let mut file = File::create("foo.txt").unwrap();
println!("{:?}", file.path());

Dependencies

~0–33MB
~459K SLoC