IO#reopen with File with File::CREAT mode fails
-----------------------------------------------

                 Key: JRUBY-1908
                 URL: http://jira.codehaus.org/browse/JRUBY-1908
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1b2
         Environment: Latest JRuby 1.1b1 from trunk
            Reporter: Vladimir Sizikov


The following script:

{noformat}
File.unlink("/tmp/test-file") if File.exists?("/tmp/test-file")
file = File.open("/tmp/test-file", File::RDWR|File::CREAT|File::EXCL, 0600)

orig_stdout = $stdout.dup

$stdout.reopen(file)
puts "TO-REOPENED-STDOUT"

$stdout = orig_stdout
puts "TO-NORMAL-STDOUT"
{noformat}

passes just fine on MRI, and prints:
TO-NORMAL-STDOUT
(and writes TO-REOPENED-STDOUT to the file too).

On JRuby, the following error is printed:
File exists - /tmp/test-file (Errno::EEXIST)

This is essentially a minimized test case of JRUBY-210, which was apparently 
not fixed.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to