fix-path-env-rs icon indicating copy to clipboard operation
fix-path-env-rs copied to clipboard

Not working with Tauri 2.0.0-rc.0

Open dodderss opened this issue 1 year ago • 1 comments

Hi, I am using the code:

fn main() {
    let _ = fix_path_env::fix(); // <---- Add this
    app_lib::run();
}

and

export async function createFile(path: string, contents: string) {
  const file = create(path, { baseDir: BaseDirectory.AppLocalData });
  (await file).write(new TextEncoder().encode(contents));
  (await file).close();
}

but I still get the error: failed to create file at path: /Users/william/Library/Application Support/myidentifier/filename.txt with error: No such file or directory (os error 2)

I am using: "@tauri-apps/api": "^2.0.0-rc.0", "@tauri-apps/cli": "^2.0.0-rc.0", "@tauri-apps/plugin-fs": "^2.0.0-rc.0",

and

fix-path-env = { git = "https://github.com/tauri-apps/fix-path-env-rs" }

dodderss avatar Aug 24 '24 20:08 dodderss

Can you try creating the folder before creating the file? Tauri won't automatically create folders it doesn't need itself and i think file.create doesn't either.

Edit: If that fixes it, this should be unrelated to fix-path-env-rs, at least none of your code shown here relies on it.

FabianLars avatar Aug 26 '24 10:08 FabianLars