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

#1063 in Filesystem

Download history 15944/week @ 2025-10-07 16245/week @ 2025-10-14 15706/week @ 2025-10-21 16094/week @ 2025-10-28 15888/week @ 2025-11-04 16913/week @ 2025-11-11 16467/week @ 2025-11-18 12173/week @ 2025-11-25 14142/week @ 2025-12-02 14173/week @ 2025-12-09 11385/week @ 2025-12-16 5348/week @ 2025-12-23 8785/week @ 2025-12-30 13457/week @ 2026-01-06 14975/week @ 2026-01-13 15915/week @ 2026-01-20

54,281 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–36MB
~458K SLoC