-
Notifications
You must be signed in to change notification settings - Fork 277
Support creating temporary files and directories #306
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
As far as I know, implementations will fallback to getenv("TEMP_DIR") as the base temp directory, do we need to provide anything else here? |
|
WASI implementations really shouldn't be doing this, nor should WASI explicitly sanction it, as that'd go against WASI's design principles: it'd make shared global state available to content implicitly. Whatever data other processes leave in that directory would now be accessible from within the sandbox. Even if you solve that part by instead creating an isolated temporary directory just for this sandboxed content, there are still tricky issues: depending on the OS and configuration, you can do DoS attacks by writing large files. And you can gather information about the system by figuring out the free space, again by writing large files, but incrementally until you get an error. We clearly should have support for |
Chiming in here: I had the exact same idea. Many applications really want/need temporary files, especially considering how important it is on Wasm to not blow up the memory usage, since allocated memory can't be reclaimed. It would also be nice to specify a minimum required size and a requested size when creating a temp dir/file, and to ask the environment for size allowance. What's the best way to push this forward? A concrete API proposal? |
That is already possible if you have any directory exposed to the wasi module. So maybe just have a |
No description provided.
The text was updated successfully, but these errors were encountered: