Open a file twice: once with fdflags::append flag (fd0) and another time without (fd1). fd_write some non-empty buffer, say "abc" to fd1, changing the file offset to 3. Now, fd_write to fd0. It should write from offset 3 due to the append flag. Instead, it writes from offset 0.
Describe the bug
Open a file twice: once with
fdflags::append
flag (fd0
) and another time without (fd1
).fd_write
some non-empty buffer, say "abc" tofd1
, changing the file offset to 3. Now,fd_write
tofd0
. It should write from offset 3 due to the append flag. Instead, it writes from offset 0.Steps to reproduce
Compile this snippet with wasi-sdk and run:
Expected behavior
The file should have content
abcd
.Actual behavior
The file has content
dbc
.