Project

General

Profile

Bug #18421

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

With an empty file `empty_file`, this seems indisputably correct. 
 ```ruby 
 File.open("empty_file") {|f| f.read(0, "abc")} #=> "" 
 ``` 

 OTOH, obviously these seem bugs. 
 ```ruby 
 File.open("empty_file") {|f|f.readpartial(0, "abc")} #=> "abc" 

 File.open("empty_file") {|f|f.read_nonblock(0, "abc")} #=> "abc" 
 ``` 

 https://github.com/ruby/ruby/pull/5323

Back