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

#141 in Filesystem

Download history 10940/week @ 2025-01-31 11018/week @ 2025-02-07 8768/week @ 2025-02-14 10799/week @ 2025-02-21 11761/week @ 2025-02-28 13300/week @ 2025-03-07 14069/week @ 2025-03-14 12263/week @ 2025-03-21 13447/week @ 2025-03-28 14260/week @ 2025-04-04 10392/week @ 2025-04-11 10111/week @ 2025-04-18 11031/week @ 2025-04-25 10675/week @ 2025-05-02 11905/week @ 2025-05-09 10353/week @ 2025-05-16

46,435 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