Skip to main content

data_local

Function data_local 

Source
pub fn data_local() -> Option<PathBuf>
Expand description

Returns the user’s local data directory (non-roaming).

This is primarily useful on Windows where it returns the local (non-roaming) data directory. On other platforms, it behaves identically to data_home().

Platform defaults:

  • Linux: ~/.local/share (same as data_home())
  • macOS: ~/Library/Application Support (same as data_home())
  • Windows: %LOCALAPPDATA% (non-roaming)

§Examples

use dir_spec::data_local;
if let Some(data_local) = data_local() {
    println!("Local data directory: {}", data_local.display());
}