File.open raises Errno::ENOENT instead of Errno::EACCES
-------------------------------------------------------

                 Key: JRUBY-4537
                 URL: http://jira.codehaus.org/browse/JRUBY-4537
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.4
            Reporter: Hiroshi Nakamura


Expecting Errno::EACCES when;

 * the file is not writable
 * trying to File.open the file for write

but 1.4 raises ENOENT and trunk raises IOError.

{noformat}
0% /home/nahi/java/jruby-1.4.0/bin/jruby -ve 'File.unlink("foo") if 
File.exist?("foo");
 File.open("foo", "w") {}; File.chmod(0555, "foo"); File.open("foo", 
File::WRONLY)'
jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3)
 (Java HotSpot(TM) Client VM 1.6.0_16) [i386-java]
-e:1:in `initialize': No such file or directory - File not found (Errno::ENOENT)
        from -e:1:in `open'
        from -e:1
1% ruby -ve 'File.unlink("foo") if File.exist?("foo"); File.open("foo", "w") {};
 File.chmod(0555, "foo"); File.open("foo", File::WRONLY)'
ruby 1.8.8dev (2010-02-01 revision 26311) [i686-linux]
-e:1:in `initialize': Permission denied - foo (Errno::EACCES)
        from -e:1:in `open'
        from -e:1
{noformat}

-- 
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