4 stable releases

1.2.0 Aug 14, 2024
1.1.0 Dec 3, 2023
1.0.1 May 18, 2023

#19 in Windows APIs

Download history 15278/week @ 2024-07-18 8762/week @ 2024-07-25 6679/week @ 2024-08-01 7556/week @ 2024-08-08 7463/week @ 2024-08-15 7447/week @ 2024-08-22 6685/week @ 2024-08-29 5851/week @ 2024-09-05 5008/week @ 2024-09-12 4129/week @ 2024-09-19 7722/week @ 2024-09-26 6963/week @ 2024-10-03 7278/week @ 2024-10-10 5972/week @ 2024-10-17 5198/week @ 2024-10-24 6098/week @ 2024-10-31

26,126 downloads per month
Used in 8 crates (5 directly)

Apache-2.0 OR MIT

70KB
449 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.2.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.60.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–8MB
~61K SLoC