Wasmer: Appending to file does not work

Created on 8 Nov 2019  ยท  5Comments  ยท  Source: wasmerio/wasmer

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.

โ“ question

All 5 comments

If you execute it with wasmtime, does it have the same problem?

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MaxGraey picture MaxGraey  ยท  3Comments

geloizi picture geloizi  ยท  4Comments

asaaki picture asaaki  ยท  3Comments

frol picture frol  ยท  4Comments

danchitnis picture danchitnis  ยท  4Comments