Project

General

Profile

Actions

Bug #11015

closed

IO.copy_stream does not advance Tempfile destination

Added by headius (Charles Nutter) over 9 years ago. Updated over 9 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
[ruby-core:<unknown>]

Description

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 when using copy_stream:

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.


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #11199: IO.copy_stream degrade that can't call pathname to pathnameClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0