https://github.com/evilpie/filepath
Get the filesystem path of a file
https://github.com/evilpie/filepath
rust
Last synced: 11 months ago
JSON representation
Get the filesystem path of a file
- Host: GitHub
- URL: https://github.com/evilpie/filepath
- Owner: evilpie
- License: apache-2.0
- Created: 2018-08-02T12:15:57.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-12-27T11:56:00.000Z (over 1 year ago)
- Last Synced: 2025-04-04T01:31:14.974Z (about 1 year ago)
- Topics: rust
- Language: Rust
- Homepage:
- Size: 23.4 KB
- Stars: 14
- Watchers: 4
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# filepath
Get the filesystem path of a file.
[](https://docs.rs/filepath/) [ ](https://crates.io/crates/filepath)
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
```rust
use std::fs::File;
use filepath::FilePath;
let mut file = File::create("foo.txt").unwrap();
println!("{:?}", file.path());
```