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

#167 in Filesystem

Download history 3963/week @ 2024-09-17 4935/week @ 2024-09-24 4532/week @ 2024-10-01 5668/week @ 2024-10-08 7117/week @ 2024-10-15 8851/week @ 2024-10-22 5948/week @ 2024-10-29 8175/week @ 2024-11-05 9549/week @ 2024-11-12 9705/week @ 2024-11-19 7316/week @ 2024-11-26 10044/week @ 2024-12-03 11801/week @ 2024-12-10 9481/week @ 2024-12-17 3328/week @ 2024-12-24 5198/week @ 2024-12-31

31,571 downloads per month
Used in 22 crates (17 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–35MB
~522K SLoC