#path #file

filepath

Get the filesystem path of a file

3 releases

Uses old Rust 2015

0.1.2 May 6, 2022
0.1.1 Aug 3, 2018
0.1.0 Aug 2, 2018

#43 in #path

Download history 529/week @ 2023-02-15 736/week @ 2023-02-22 788/week @ 2023-03-01 884/week @ 2023-03-08 773/week @ 2023-03-15 570/week @ 2023-03-22 599/week @ 2023-03-29 564/week @ 2023-04-05 410/week @ 2023-04-12 807/week @ 2023-04-19 779/week @ 2023-04-26 584/week @ 2023-05-03 638/week @ 2023-05-10 904/week @ 2023-05-17 688/week @ 2023-05-24 614/week @ 2023-05-31

3,014 downloads per month
Used in 12 crates (11 directly)

Apache-2.0/MIT

7KB
101 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

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

~36KB