https://github.com/mentaljam/standard_paths
A Rust port of QStandardPaths class which provides methods for accessing standard paths on the local filesystem (config, cache, user directories and etc.).
https://github.com/mentaljam/standard_paths
directory library location paths rust standard storage
Last synced: 9 months ago
JSON representation
A Rust port of QStandardPaths class which provides methods for accessing standard paths on the local filesystem (config, cache, user directories and etc.).
- Host: GitHub
- URL: https://github.com/mentaljam/standard_paths
- Owner: mentaljam
- License: mit
- Created: 2017-12-03T13:43:12.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2023-09-11T06:58:06.000Z (almost 3 years ago)
- Last Synced: 2025-09-04T02:43:08.179Z (9 months ago)
- Topics: directory, library, location, paths, rust, standard, storage
- Language: Rust
- Homepage: https://docs.rs/crate/standard_paths
- Size: 73.2 KB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Standard Paths
A Rust library providing methods for accessing standard paths on the local filesystem (config, cache, user directories and etc.).
It's a port of [QStandardPaths](https://doc.qt.io/qt-5/qstandardpaths.html) class of the Qt framework.
[](https://crates.io/crates/standard_paths)
[](https://crates.io/crates/standard_paths)
[](https://docs.rs/standard_paths)
### Currently implemented for Linux and Windows
- [writable_location](https://docs.rs/standard_paths/~0/standard_paths/struct.StandardPaths.html#method.writable_location)
- [standard_locations](https://docs.rs/standard_paths/~0/standard_paths/struct.StandardPaths.html#method.standard_locations)
- [find_executable](https://docs.rs/standard_paths/~0/standard_paths/struct.StandardPaths.html#method.find_executable)
- [find_executable_in_paths](https://docs.rs/standard_paths/~0/standard_paths/struct.StandardPaths.html#method.find_executable_in_paths)
- [locate](https://docs.rs/standard_paths/~0/standard_paths/struct.StandardPaths.html#method.locate)
- [locate_all](https://docs.rs/standard_paths/~0/standard_paths/struct.StandardPaths.html#method.locate_all)
### macOS support
macOS is currently unsupported. If you want to help with macOS feel free to contribute!
### Usage
#### Cargo.toml
```toml
[dependencies]
standard_paths = "^2.0"
```
#### main.rs
```rust
use standard_paths::{LocationType, StandardPaths};
fn main() {
let sp = StandardPaths::new("app", "org");
println!("{:?}", sp.writable_location(LocationType::AppLocalDataLocation));
}
```