I am trying to run a simple wasm program, see code here
I am running: wasmer run --dir=. demo.wasm '{"a":"txt", "b":1}'
which should append txt 1 to a log.txt file.
However, the data is not appending but instead writing over. The same program compiled with native Rust (non-wasm) appends properly.
If you execute it with wasmtime, does it have the same problem?
Looks like there's no logic for append here: https://github.com/wasmerio/wasmer/blob/master/lib/wasi/src/syscalls/mod.rs#L1726-L1742
If you execute it with wasmtime, does it have the same problem?
With wasmtime the program does not execute at all, I get the following error:
thread 'main' panicked at 'write failed: Os { code: 76, kind: Other, message: "Capabilities insufficient" }', src/libcore/result.rs:1084:5
Seems like it's an fdflag __WASI_FDFLAG_APPEND
Thanks for reporting this! I'll investigate and ship a fix