Branch: refs/heads/master Home: https://github.com/MacRuby/MacRuby Commit: af05b3f7e4fa38f55f942b3adaf372903dd8f42f https://github.com/MacRuby/MacRuby/commit/af05b3f7e4fa38f55f942b3adaf372903d... Author: Watson <watson1978@gmail.com> Date: 2011-05-30 (Mon, 30 May 2011) Changed paths: M io.c Log Message: ----------- IO#dup will copy a file path. Test Script: {{{ require 'test/unit/assertions.rb' include Test::Unit::Assertions io = STDOUT.dup assert_equal("#<IO:<STDOUT>>", io.inspect) io = File.open("/tmp/foo", "w") io2 = io.dup assert_equal("#<File:/tmp/foo>", io2.inspect) io.close r, w = IO.pipe io = r.dup assert_match(/#<IO:fd \d+>/, io.inspect) f = File.open("/tmp/foo", "w") w.reopen(f) assert_equal("/tmp/foo", w.path) puts :ok }}}