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

#152 in Filesystem

Download history 9814/week @ 2024-11-18 7064/week @ 2024-11-25 10281/week @ 2024-12-02 11524/week @ 2024-12-09 10420/week @ 2024-12-16 3567/week @ 2024-12-23 4542/week @ 2024-12-30 8916/week @ 2025-01-06 10405/week @ 2025-01-13 9081/week @ 2025-01-20 9835/week @ 2025-01-27 11657/week @ 2025-02-03 10289/week @ 2025-02-10 9577/week @ 2025-02-17 10496/week @ 2025-02-24 12062/week @ 2025-03-03

42,816 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–33MB
~464K SLoC