File.open should throw Errno::EACCES when opening non-permitted file
--------------------------------------------------------------------

                 Key: JRUBY-1614
                 URL: http://jira.codehaus.org/browse/JRUBY-1614
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.x
         Environment: Ubuntu Linux 7.10,
ruby 1.8.5 (2007-11-23 rev 4842) [i386-jruby1.1b1]
            Reporter: Vladimir Sizikov


File.open should throw Errno::EACCES when opening non-permitted file.

The following example ilustrates the problem (first, create out.txt file, 
before running the example):

fh = File.open("out.txt", "w")
fh.chmod(000)
File.open("out.txt")

MRI:
Permission denied - out.txt (Errno::EACCES)

JRuby:
`open': File not found (Errno::ENOENT)

Also note that JRuby doesn't provide the name of the file, but the name would 
have been very useful!

This leads to one Rubinius spec test failure in core/file/open_spec.rb:

15)
File.open should throw Errno::EACCES when opening non-permitted file FAILED
Expected Errno::EACCES, got Errno::ENOENT (File not found):
/opt/work/rubinius/./spec/core/file/../../mspec_helper.rb:17:in `should_raise'
/opt/work/rubinius/./spec/core/file/open_spec.rb:351:in `should_raise'
/opt/work/rubinius/./spec/core/file/open_spec.rb:351:in `it'
/opt/work/rubinius/spec/mini_rspec.rb:403:in `it'
/opt/work/rubinius/./spec/core/file/open_spec.rb:348:in `it'
/opt/work/rubinius/./spec/core/file/open_spec.rb:348:in `describe'
/opt/work/rubinius/spec/mini_rspec.rb:399:in `describe'
/opt/work/rubinius/./spec/core/file/open_spec.rb:3:in `describe'
/opt/work/rubinius/./spec/core/file/open_spec.rb:3:in `load'
last_mspec.rb:11:in `load'
last_mspec.rb:1:in `each'
last_mspec.rb:6:in `each'


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