Skip to content

IO.copy_stream keep pos of destination to beginning of file #3280

@HoneyryderChuck

Description

@HoneyryderChuck

This is the minimum repro I could make:

require "stringio"
require "tempfile"
a = StringIO.new
a << ("a"*100000)
b = Tempfile.new("test", encoding: Encoding::BINARY, mode: File::RDWR)
a.rewind
IO.copy_stream(a, b)
puts b.pos

Using ruby 3.2, the output is 100000, whereas in truffleruby, output is 0.

version was truffleruby 22.3.1, like ruby 3.0.3, GraalVM CE Native [x86_64-linux] (I use truffleruby for tests in docker, there is no v23 image available yet).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions