-
Notifications
You must be signed in to change notification settings - Fork 264
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
[fs][v2] scope-wide requireLiteralLeadingDot config not working #1927
Comments
Can you also share your configured permissions? |
{
"fs:read-files",
"fs:allow-write-file",
"fs:allow-copy-file",
"fs:allow-remove",
{
"identifier": "fs:scope",
"allow": ["**/*"]
},
} |
It works fine in macos and windows! Only in linux it reports errors! |
Yeah, if you only use that scope than the dot is indeed the issue. Either add explicit {
"identifier": "fs:scope",
"allow": ["**/*"],
"requireLiteralLeadingDot": false
}, |
Hey👋, iShot_2024-10-13_21.55.56.mp4 |
Hmm, that's weird. Just to double check, does |
iShot_2024-10-13_22.04.10.mp4export const writeFile = (
path: string,
data: string,
options?: WriteFileOptions,
) => {
const encoder = new TextEncoder();
const encodeData = encoder.encode(data);
return tauriWriteFile(path, encodeData, options);
};
await writeFile(getBackupStorePath(), JSON.stringify(content)); |
On macOS and windows, it is normal iShot_2024-10-13_22.06.40.mp4 |
If you use the dialog plugin for that then the scope would be dynamically extended btw, but yeah your solution works too of course.
Yeah, that's just another argument for the dot being the issue. I guess the scope-wide requireLiteralLeadingDot setting doesn't work right now then. Try adding this to tauri.conf.json then: {
"plugins": {
"fs": {
"requireLiteralLeadingDot": false
}
}
} |
It's working fine, thanks! This error report should be a problem caused by other code! iShot_2024-10-13_22.17.28.mp4 |
writeFile
By the way, I looked at the source code for the plugins-workspace/plugins/fs/src/commands.rs Line 1117 in 7e1c17a
|
well, it's at least not supposed to get the correct folder size because that only works by iterating over all files recursively which is just too slow for a simple stat function. I don't know whether it should still call len() or just return 0 but as long as it doesn't panic or anything i think it's fine as-is (isn't a folder 4kb or something on Linux?). |
This is the problem I encountered with |
The
writeFile
execution reported an error, I suspect that it is because the path is a path containing a.
path, how can I fix this? I am usingappDataDir
path!The text was updated successfully, but these errors were encountered: