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
[bug] readDir and createDir don't work in App Dir root level #3580
Comments
It works if you set your FS scope to |
@lucasfernog 1. is that documented? 2. How is it done? Asking because I ran into this after upgrading from beta version where it worked without. |
The scope was added in the RC versions as a result of the audit. We have the documentation here though it could be improved with this confusion here about reading files vs. directories. |
@lucasfernog Thanks a lot, sorry for not finding it. |
Describe the bug
fs.readDir
andfs.createDir
don't work in App Dir root level in 1.0.0-rc, but was working fine in beta.Those methods work only on a sub-directory of the specified BaseDirectory.
Use case: Checking if App dir exists, creating it otherwise, and write a file in it.
Here
readDir
with throw withpath not allowed on the configured scope: /Users/stephane/Library/Application Support/tdex-dashboard/
, even though it is not a scope issue.Calling
writeFile
without checking if app dir exists obviously results inNo such file or directory (os error 2)
error.Instead or in addition to fixing readDir/createDir, writeFile could create folder if it doesn' exist.
https://discord.com/channels/616186924390023171/731495028677148753/948156122261495808
Reproduction
No response
Expected behavior
No response
Platform and versions
Stack trace
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: