-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(fs): improved API #751
Conversation
It doesn't compile with the watch feature enabled. Just a fairly small change though (the main thing is that resolve_path expects a SafePathBuf) but i won't push it to not risk conflicts if you have local commits left :) (p.s. opened #761 to test more features in ci) The main api change looks solid to me though (though i do think node's fs api is a bit weird idk), and what i tested so far worked nicely! 🥳 (i'll do some more testing tomorrow) |
Alright, watcher flag should be fine now, and feel free to push your changes if you need, I don't have any more changes planned.
The API is inspired from Deno and Node and the main goal was to make it more familiar to those coming from node. |
plugins/fs/src/commands.rs
Outdated
} | ||
} | ||
|
||
opts.read(options.read.unwrap_or(true)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they should all default to false (via serde instead of all the logic here); what if I want a file to be write-only for security reasons?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should I also change the default (the None
case) behavior when options were not provided, to set read
to false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually we need to keep read
to true
, otherwise opening a file without read
or write
will fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if someone wants a write-only file, they will need to specify write: true, read: false
Why was the |
I guess for security reasons, since |
btw this PR is blocked until tauri-apps/tauri#8370 |
ff46b47
to
ff17aae
Compare
No description provided.