Skip to main content


pub fn resolve_path<P: AsRef<Path>>(
    config: &Config, 
    package_info: &PackageInfo, 
    path: P, 
    dir: Option<BaseDirectory>
) -> Result<PathBuf>

Resolves the path with the optional base directory.


use tauri::api::{path::{resolve_path, BaseDirectory}, PackageInfo};
// we use the default config and a mock PackageInfo, but in an actual app you should get the Config created from tauri.conf.json and the app's PackageInfo instance
let path = resolve_path(
  &PackageInfo {
    name: "app".into(),
    version: "1.0.0".into(),
 ).expect("failed to resolve path");
// path is equal to "/home/${whoami}/.config/path/to/something" on Linux