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

#174 in Filesystem

Download history 5836/week @ 2024-10-30 8561/week @ 2024-11-06 9665/week @ 2024-11-13 9693/week @ 2024-11-20 7815/week @ 2024-11-27 10032/week @ 2024-12-04 12256/week @ 2024-12-11 7456/week @ 2024-12-18 3229/week @ 2024-12-25 6903/week @ 2025-01-01 8830/week @ 2025-01-08 10215/week @ 2025-01-15 9314/week @ 2025-01-22 11108/week @ 2025-01-29 11467/week @ 2025-02-05 7198/week @ 2025-02-12

40,978 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
~468K SLoC