as-wasi icon indicating copy to clipboard operation
as-wasi copied to clipboard

Reading/Writing to a file without permissions should error?

Open torch2424 opened this issue 5 years ago • 2 comments

For example in: https://github.com/jedisct1/as-wasi/blob/master/assembly/as-wasi.ts#L281

I didn't realize I had the wrong permissions when opening a file, so when I tried to write to the file, it would silently fail. Perhaps we should think of a way to handle this? 😄

torch2424 avatar Jan 10 '20 23:01 torch2424

Hi!

Oh, absolutely. All I/O functions can fail, so returning void isn't the right thing to do here :/

jedisct1 avatar Jan 11 '20 02:01 jedisct1

@jedisct1 Awesome! I'll try an open a PR once I get the chance so we can make it error or something 😄 👍

torch2424 avatar Jan 14 '20 02:01 torch2424