Skip to content
Discussion options

You must be logged in to vote

The scope setting is only relevant for the javascript/webview side so let's ignore that for now.

Tauri also does not change the behavior of std::fs (it couldn't do that anyway) so "$APPDATA/.accounts" means that it will try to create a $APPDATA (literally) directory in the current working dir.

To get the correct dir you'll have to use https://docs.rs/tauri/latest/tauri/struct.PathResolver.html#method.app_data_dir, for this you need access to an App/AppHandle which typically means to move the code into tauri's setup hook:

tauri::Builder::default()
  .setup(|app| {
    // This will give us the actual path to $APPDATA
    let path = app.path_resolver().app_data_dir().expect("This should neve…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@FabianLars
Comment options

Answer selected by gzuuus
@gzuuus
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants