Actions
Bug #18421
closed`IO#readpartial` and `IO#read_nonblock` return non-empty string on empty file
Bug #18421:
`IO#readpartial` and `IO#read_nonblock` return non-empty string on empty file
Description
With an empty file empty_file, this seems indisputably correct.
File.open("empty_file") {|f| f.read(0, "abc")} #=> ""
OTOH, obviously these seem bugs.
File.open("empty_file") {|f|f.readpartial(0, "abc")} #=> "abc"
File.open("empty_file") {|f|f.read_nonblock(0, "abc")} #=> "abc"
Actions