# \[Bug #2516\] IO#reopen Compatibility (original: )

**URL:** <https://www.ruby-forum.com/t/bug-2516-io-reopen-compatibility-original/180607>\
**Category:** Development\
**Created:** [December 22, 2009, 9:30pm UTC](https://www.ruby-forum.com/t/bug-2516-io-reopen-compatibility-original/180607 "2009-12-22T21:30:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ujihisa\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/8edcca/32.png) [@ujihisa\_S](https://www.ruby-forum.com/u/ujihisa_S)\
**Post date:** [December 22, 2009, 9:30pm UTC](https://www.ruby-forum.com/t/bug-2516-io-reopen-compatibility-original/180607/1 "2009-12-22T21:30:41Z")

</div>

Bug #2516: IO#reopen Compatibility (original: [ruby-dev:39479])  
[http://redmine.ruby-lang.org/issues/show/2516](http://redmine.ruby-lang.org/issues/show/2516)

e$B5/I\<\<Te(B: ujihisa .  
e$B%9%F!\<%?%9e(B: Assigned, e$BM%@hEYe(B: Normal  
e$BC4Ev\<Te(B: Nobuyoshi N., e$B%+%F%4%je(B: core, Target version:  
1.9.2  
ruby -v: ruby 1.9.2dev (2009-12-22 trunk 26152) [i386-darwin9.8.0]

takkanme$B$5$s$H$J$+$@$5$s$Ne(B[ruby-dev:39479]e$B$N%9%l%C%I$K$h$k$H!“e(BIO#reopene$B$Ne(Bnile$B$NLdBj$O2r7h$7$?$b$N$N!”$$$D$N$^$K$+5sF0$,JQ99$5$l$F$$$?$H$N$3$H$G$9!#e(B  
e$B$3$NJQ99$O0U?^E\*$J$b$N$J$N$+0U?^$7$F$$$J$$$b$N$J$N$+$I$A$i$J$N$G$7$g$&!#e(B

```
% cat test.rb
f1 = File.open "file1.txt"
f2 = File.open "file2.txt"
f1.reopen f2
puts f1.gets
puts f1.gets
puts(f1.reopen(f2).gets)
% ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9]
% ruby test.rb
Line 1
Line 2
Line 1
% ruby -v
ruby 1.9.2dev (2009-10-17 trunk 25387) [i386-darwin9.8.0]
% ruby test.rb
Line 1
Line 2
Line 3

```

e$B$3$Ne(Bissuee$B$Oe(B #1755 e$B$K$b4XO"$7$F$$$^$9!#e(B  
[http://redmine.ruby-lang.org/issues/show/1755](http://redmine.ruby-lang.org/issues/show/1755)

e$B0U?^$7$?$b$N$J$i$P!"$3$NJQ99$re(BRubySpece$B$K$bH?1G$5$;$^$9!#e(B

# e$B8D?ME\*$K$O8=\>u$N5sF0$,4r$7$$$G$9!#e(B
