bytecodealliance / bytecodealliance/wasmtime
WasiCtx and preopen
Open
- Dominant language
- Rust
- Stars
- 18.6k
- Forks
- 1.8k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 126
Description
Hi,
`Wasi::new` takes a `WasiCtx` parameter that can be created with environment args as shown in your examples on WASI and linking. With the wasmtime binary you can pass the `--dir` parameter to preopen a directory where the wasm module can read a file from. I did not so far get this to work when instantiating a WASI module using your API. It seems the args passed into the `WasiCtx` creation does not end up with directories being pre-opened. The end result is that file IO from a WASI module does not seem to work unless you are calling it from the wasmtime binary. Maybe I'm missing something? Thanks.
Contributor guide
Assessment
This issue has not been assessed yet.