Skip to content

Latest commit

Β 

History

352 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

known-folders-rs

GitHub Actions Twitter
Crate API

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.4.2"

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.

Development

This repository uses mise to manage the local development toolchain declared in mise.toml, including Node.js, Rust, cargo-deny, and zizmor. For Rust, mise installs the stable toolchain via rustup.

Install the shared toolchain with:

mise install

Then install the repo-local pnpm dependencies with:

pnpm install

Common checks run directly through the underlying tools:

cargo fmt --check
cargo clippy --workspace --all-features --all-targets
cargo test --workspace
pnpm run fmt:check

Maintenance of this repository is Codex-first. Prefer asking Codex to make routine code, documentation, CI, and dependency updates, then review the resulting diff and CI status before merging. See CONTRIBUTING.md for contribution expectations.

License

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

About

πŸͺŸ πŸ“ Rust bindings to the Known Folders API on Windows

Topics

Resources

Contributing

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages