A safe wrapper around SHGetKnownFolderPath
.
```rust use windirs::{Error, FolderId, getknownfolder};
let localappdatapath = match getknownfolder(FolderId::LocalAppData) { Ok(path) => path, Err(err) => match err { // Some folder ids point to virtual paths, so, yeah. Error::Virtual => panic!(), // When no folder is found. Error::NotFound => panic!(), // Can occur for a variety of reasons, such as this folder id being unknown to this OS. Error::InvalidArg(ioerror) => panic!(), // Any other potential OS error that could happen, but is not defined by the API. Error::Other(io_error) => panic!(), } }
let userhomepath = getknownfolder(FolderId::Profile).unwrap(); ```
This project is licensed under either of
at your option.