How To Write To User Selected Directory On Host (Client) Machine? #9938
Unanswered
RomanoViolet
asked this question in
Q&A
Replies: 1 comment
-
the most common reason i've seen for os error 13 in tauri apps is that devs tried to write a file onto a folder path (basically the path was missing the file name). I think you'll also get e13 if the file already exists and is in use. Do you have a full example path you actually tried? Or maybe a bit of your js code? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Setup
I am building a tauri app with sveltekit as frontend and rust as backend.
The app is expected to steam ASCII-text data from a server and is expected to write it to a user specified location on the client machine.
This is different to the question on storing configuration data. My problem is to write results of a compute which are passed onto the client side from the server.
Problem
I run into the error
Permission deined (os error 13)
What I Have Tried So Far
Verified File System Permissions
chmod 755 <intended write directory>
, but the result did not changeUpdated
tauri.conf.json
Added:
"tauri": { "allowlist": { "fs": { "all": true, "writeFile": true, "createDir": true } },
"security": { "csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'" },
Functions in rust are defined in
main.rs
as follows:Using Application Binary And Not Web App
I am using application binary, and not a web interface:
Information
[✔] Environment
- OS: Ubuntu 22.04 X64
✔ webkit2gtk-4.0: 2.44.2
✔ rsvg2: 2.52.5
✔ rustc: 1.78.0 (9b00956e5 2024-04-29)
✔ cargo: 1.78.0 (54d8815d0 2024-03-26)
✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
- node: 20.14.0
- npm: 10.7.0
[-] Packages
- tauri [RUST]: 1.6.7
- tauri-build [RUST]: 1.5.2
- wry [RUST]: 0.24.10
- tao [RUST]: 0.16.9
- @tauri-apps/api [NPM]: 1.5.6
- @tauri-apps/cli [NPM]: 1.5.14
[-] App
- build-type: bundle
- CSP: default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'
- distDir: ../build
- devPath: http://localhost:5173/
- framework: Svelte
- bundler: Webpack
Request
/home/user/Data/
It is important for my app to be able to write on host-machine at user-specified location as part of requirements. This is not a general web application, but is constrained to connect to a specified IP address "server" backend where compute is organized.
Many thanks!
Beta Was this translation helpful? Give feedback.
All reactions