Project

General

Profile

Bug #11015

Updated by nobu (Nobuyoshi Nakada) almost 9 years ago

The following script, reported to JRuby in https://github.com/jruby/jruby/issues/2762, shows that MRI does not advance the position of a `Tempfile` Tempfile when using `copy_stream`: copy_stream: 

 ~~~ruby 
 require "stringio" 
 require "tempfile" 
 file = Tempfile.new('foo') 
 IO.copy_stream(StringIO.new('foo'), file) 
 file.eof? #=> false (it's on the beginning) 
 ~~~ 

 Other types of streams leave the destination where it is after the copy, so I believe this is a bug.

Back