Function xdirs::data_local_dir_for[][src]

pub fn data_local_dir_for(app: &str) -> Option<PathBuf>

Returns the path to the user’s local data 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.

PlatformValueExample
Linux$XDG_DATA_HOME or $HOME/.local/share/{app}/home/alice/.local/share/MyApp
macOS$HOME/Library/Application Support/{app}/Users/Alice/Library/Application Support/MyApp
Windows{FOLDERID_LocalAppData}/{app}C:\Users\Alice\AppData\Local\MyApp

See also data_local_dir.