Function xdirs::preference_dir_for [−][src]
pub fn preference_dir_for(app: &str) -> Option<PathBuf>
Returns the path to the user’s preference file directory for a specific application.
The returned value depends on the operating system and is either a Some
, containing a value
from the following table, or a None
.
Platform | Value | Example |
---|---|---|
Linux | $XDG_DATA_HOME or $HOME /.config | /home/alice/.config |
macOS | $HOME /Library/Preferences/{app} | /Users/Alice/Library/Preferences/Chrome |
Windows | {FOLDERID_RoamingAppData} /{app} | C:\Users\Alice\AppData\Roaming\MyApp |
See also preference_dir
.