-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Description
@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.
Metadata
Metadata
Assignees
Labels
No labels