You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Imagine I'm reading a file slice by slice, using successive calls to Eio.File.pread.
When I reach the end of the file (i.e. when I pass a ~file_offset equal to the number of bytes in the file), Eio.File.pread returns a length of 0 and thus the assert fails.
It appears to me that the author expected t#pread to raise End_of_file to indicate EOF.
Either the Eio_posix implementation of Eio.File.ro#pread needs to raise End_of_file, or the assertion should be
assert (got <=Cstruct.lenv bufs);
I might be wrong here! but at the moment I'm having to circumvent Eio.File.pread by making direct calls to t#pread.
The text was updated successfully, but these errors were encountered:
Yes, eio_posix needs to change (#581). The assert is here precisely to make sure that all the backends behave the same way (eio_linux already raises End_of_file here).
I might be wrong, but this assert appears misguided to me.
Imagine I'm reading a file slice by slice, using successive calls to
Eio.File.pread
.When I reach the end of the file (i.e. when I pass a
~file_offset
equal to the number of bytes in the file),Eio.File.pread
returns a length of0
and thus theassert
fails.It appears to me that the author expected
t#pread
to raiseEnd_of_file
to indicate EOF.Either the
Eio_posix
implementation ofEio.File.ro#pread
needs to raiseEnd_of_file
, or the assertion should beI might be wrong here! but at the moment I'm having to circumvent
Eio.File.pread
by making direct calls tot#pread
.The text was updated successfully, but these errors were encountered: