Hi there,
this comes up ƒrom today's Go Subgroup meeting where @Damian Gryski was discussing some of the challenges in implementing wasip2 in TinyGo. The question is how to implement seek
in wasip2. While wasi:io provides a skip
function that allow you to advance the stream's current position by an offset, but it doesn't allow bacward movement or movement relative to the end of the stream that seek
offers.
One possible implemention would be replacing skip
with seek
that takes an signed inteter as the offset, allowing it to go forward or backward. This might be challenging since not all streams support seeking. e.g. network data. What do you think?
FYI @Pat Hickey @Dan Gohman @Randy Reddig @Bailey Hayes
The way seek
is expected to be implemented is by dropping the old stream, and creating a new stream at the new offset, by calling read-via-stream
or write-via-stream
on the descriptor
.
^ That sounds just like the approach @Damian Gryski landed on
Last updated: Nov 22 2024 at 17:03 UTC