-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
I'm not sure what the precise semantics of seek should be. Currently, it's underdefined, and I think we should exploit that the current lack of documentation (and inconsistent behaviour) gives us freedom to define seek as we want (rather than just documenting how it actually behaves currently).
- Is the position always an integer, or can an IO define a custom indexing type e.g. to carry state?
- Should it be documented that the position must be zero-indexed?
- What should the behaviour be when seeking to a negative offset? This errors for
IOStream, but not forIOBuffer - What should the behaviour be when seeking to something larger than the filesize? Currently, it seeks to the end, but @vtjnash in Refactor IOBuffer code #57570 suggested it should instead behave like lseek.
- What should happen when calling
seekon an unseekable IO? Should it be a noop or throw an error? Which error?
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