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

#1578 in Filesystem

Download history 15884/week @ 2026-01-23 13209/week @ 2026-01-30 14356/week @ 2026-02-06 11006/week @ 2026-02-13 13221/week @ 2026-02-20 11960/week @ 2026-02-27 18084/week @ 2026-03-06 19865/week @ 2026-03-13 15578/week @ 2026-03-20 15215/week @ 2026-03-27 14629/week @ 2026-04-03 15906/week @ 2026-04-10 14493/week @ 2026-04-17 11831/week @ 2026-04-24 11293/week @ 2026-05-01 20435/week @ 2026-05-08

61,106 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–35MB
~457K SLoC