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

#176 in Filesystem

Download history 7353/week @ 2024-10-27 7527/week @ 2024-11-03 9116/week @ 2024-11-10 9878/week @ 2024-11-17 7156/week @ 2024-11-24 10177/week @ 2024-12-01 11556/week @ 2024-12-08 10508/week @ 2024-12-15 3636/week @ 2024-12-22 4501/week @ 2024-12-29 8827/week @ 2025-01-05 10336/week @ 2025-01-12 9105/week @ 2025-01-19 9846/week @ 2025-01-26 11689/week @ 2025-02-02 10222/week @ 2025-02-09

41,362 downloads per month
Used in 25 crates (20 directly)

Apache-2.0/MIT

8KB
93 lines

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());

lib.rs:

filepath

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

Dependencies

~0–34MB
~468K SLoC