-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Open
Labels
ioInvolving the I/O subsystem: libuv, read, write, etc.Involving the I/O subsystem: libuv, read, write, etc.needs decisionA decision on this change is neededA decision on this change is needed
Description
The semantics of position
are not clear, and depending on the choices, some implementations may be buggy. In particular:
- Must
position
be an integer, or can it be a custom struct? - When having an IO struct that represents a compressed file being decompressed, is the position the position of the underlying file, or the decompressed data?
- Must
position
be monotonically increasing as the IO reads/writes? Or, are IOs allowed to destroy previously read data, such thatposition
may decrease? - Is
position
meaningful for non-seekable IOs?
The following behaviour may or may not be buggy
buf = PipeBuffer(; maxsize=8)
write(buf, "abcdefgh")
@assert position(buf) == 0
read(buf, 2)
@assert position(buf) == 2
write(buf, 2)
@assert position(buf) == 0
Metadata
Metadata
Assignees
Labels
ioInvolving the I/O subsystem: libuv, read, write, etc.Involving the I/O subsystem: libuv, read, write, etc.needs decisionA decision on this change is neededA decision on this change is needed