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

#165 in Filesystem

Download history 5138/week @ 2024-09-26 4948/week @ 2024-10-03 6032/week @ 2024-10-10 7297/week @ 2024-10-17 8587/week @ 2024-10-24 5871/week @ 2024-10-31 8916/week @ 2024-11-07 9741/week @ 2024-11-14 9293/week @ 2024-11-21 8400/week @ 2024-11-28 10648/week @ 2024-12-05 11839/week @ 2024-12-12 5647/week @ 2024-12-19 3331/week @ 2024-12-26 8128/week @ 2025-01-02 9300/week @ 2025-01-09

28,793 downloads per month
Used in 23 crates (18 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
~469K SLoC