Closed jdelStrother closed 11 months ago
@casperisfine / @byroot thanks for the pread implementation!
However, there's a slight difference in how it treats the edge case of reading zero bytes from an empty file
File.open("empty_file").pread(0,0) # => "" StringIO.new(File.read("empty_file")).pread(0,0) # => raises `end of file reached (EOFError)`
In our case, this is almost certainly a bug in the application logic where it ought to bail out early rather than trying to read zero bytes from the io, but thought it was worth highlighting the discrepancy.
Thanks. I'm busy for the next couple days but I'll make sure to have a look next week.
@casperisfine / @byroot thanks for the pread implementation!
However, there's a slight difference in how it treats the edge case of reading zero bytes from an empty file
In our case, this is almost certainly a bug in the application logic where it ought to bail out early rather than trying to read zero bytes from the io, but thought it was worth highlighting the discrepancy.