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.
Add this to your Cargo.toml
:
toml
[dependencies]
known-folders = "1.0.1"
Then resolve well-known directories like this:
```rust use knownfolders::{getknownfolderpath, KnownFolder};
let profiledir = getknownfolderpath(KnownFolder::Profile); ```
You can test this crate works on your platform by running the example:
shell
cargo run --example get_profile_dir
known-folders-rs binds directly to Win32
using [windows_sys
].
Note that this crate is completely empty on non-Windows platforms.
This crate requires at least Rust 1.58.0. This version can be bumped in minor releases.
known-folders-rs
is distributed under the terms of either the
MIT License or the
Apache License (Version 2.0).