Is there a way to pass data into stdin via wasi context?
When file already exist it will be truncated during wasi context creation
final var stdinPath = Paths.get("./wasm/io/stdin.txt");
Files.writeString(stdinPath, "{\"name\": \"John\"}");
final var wasi = new WasiCtxBuilder()
.stdin(stdinPath)
.build();
Another case, when trying to write data after context creation it is ignored
final var stdinPath = Paths.get("./wasm/io/stdin.txt");
final var wasi = new WasiCtxBuilder()
.stdin(stdinPath)
.build();
Files.writeString(stdinPath, "{\"name\": \"John\"}");
You can find full working example here: https://github.com/amysyk-viax-io/wasmtime-java-stdin-stdout