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

#118 in Filesystem

Download history 3709/week @ 2024-12-21 4573/week @ 2024-12-28 8574/week @ 2025-01-04 10352/week @ 2025-01-11 9022/week @ 2025-01-18 10073/week @ 2025-01-25 11479/week @ 2025-02-01 10316/week @ 2025-02-08 9567/week @ 2025-02-15 10569/week @ 2025-02-22 11624/week @ 2025-03-01 13400/week @ 2025-03-08 14243/week @ 2025-03-15 12379/week @ 2025-03-22 14123/week @ 2025-03-29 11231/week @ 2025-04-05

54,167 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
~457K SLoC