3 stable releases

1.1.0 Dec 3, 2023
1.0.1 May 18, 2023

#17 in Windows APIs

Download history 3222/week @ 2024-01-06 5491/week @ 2024-01-13 6531/week @ 2024-01-20 8345/week @ 2024-01-27 8942/week @ 2024-02-03 10732/week @ 2024-02-10 12895/week @ 2024-02-17 13942/week @ 2024-02-24 14066/week @ 2024-03-02 11572/week @ 2024-03-09 9725/week @ 2024-03-16 7125/week @ 2024-03-23 6821/week @ 2024-03-30 4942/week @ 2024-04-06 6551/week @ 2024-04-13 4062/week @ 2024-04-20

22,950 downloads per month
Used in 13 crates (4 directly)

Apache-2.0 OR MIT

70KB
448 lines

known-folders-rs

GitHub Actions Discord Twitter
Crate API API trunk

Retrieves the full path of a known folder identified by the folder's KNOWNFOLDERID on Windows systems using SHGetKnownFolderPath and the Known Folders API.

The Known Folders API first appeared in Windows Vista.

Usage

Add this to your Cargo.toml:

[dependencies]
known-folders = "1.1.0"

Then resolve well-known directories like this:

use known_folders::{get_known_folder_path, KnownFolder};

let profile_dir = get_known_folder_path(KnownFolder::Profile);

You can test this crate works on your platform by running the example:

cargo run --example get_profile_dir

Implementation

known-folders-rs binds directly to Win32 using windows_sys. Semver-incompatible windows_sys upgrades can be made in minor releases.

Note that this crate is completely empty on non-Windows platforms.

Minimum Supported Rust Version

This crate requires at least Rust 1.58.0. This version can be bumped in minor releases.

License

known-folders-rs is distributed under the terms of either the MIT License or the Apache License (Version 2.0).

Dependencies

~0–9MB
~64K SLoC