#path #standard #directory #location #storage #local-filesystem

standard_paths

A port of QStandardPaths class which provides methods for accessing standard paths on the local filesystem (config, cache, user directories and etc.)

14 releases (6 stable)

2.1.0 Aug 3, 2023
2.0.1 May 3, 2023
2.0.0 Dec 21, 2022
1.2.0 Dec 13, 2022
0.3.1 Dec 8, 2017

#271 in Filesystem

Download history 1/week @ 2024-02-19 26/week @ 2024-02-26 9/week @ 2024-03-04 18/week @ 2024-03-11 7/week @ 2024-03-18 28/week @ 2024-03-25

62 downloads per month
Used in 2 crates

MIT license

43KB
820 lines

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 class of the Qt framework.

Crates Version Crates Downloads Documentation

Currently implemented for Linux and Windows

macOS support

macOS is currently unsupported. If you want to help with macOS feel free to contribute!

Usage

Cargo.toml

[dependencies]
standard_paths = "^2.0"

main.rs

use standard_paths::{LocationType, StandardPaths};

fn main() {
    let sp = StandardPaths::new("app", "org");
    println!("{:?}", sp.writable_location(LocationType::AppLocalDataLocation));
}

Dependencies

~0–9MB
~56K SLoC