Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: JRuby 1.7.0.pre2
-
Component/s: None
-
Labels:None
-
Environment:"jruby 1.6.7.2 (ruby-1.8.7-p357) (2012-05-01 26e08ba) (Java HotSpot(TM) Client VM 1.6.0_33) [Windows 7-x86-java]"
-
Testcase included:yes
-
Number of attachments :
Description
Basically, if you are in directory "a", and have subdirectory "b", like
a/b
and also file a/filename
Then the following should occur:
>> Dir.chdir 'b'
>> File.read('filename')
Errno::ENOENT: No such file or directory - filename
...
however, in jruby you get this instead:
>> Dir.chdir 'b'
>> File.read('filename')
Errno::EACCES: Permission denied - filename
...
(wrong exception class).
Perhaps you can submit a test to MRI folks for this behavior (or confirm whether such a test exists already?)
commit 92fe8de00d0e8bdd135c33f679001a26d01d7443 Author: Charles Oliver Nutter <headius@headius.com> Date: Tue Jul 24 14:12:29 2012 -0500 Fix JRUBY-6774 wrong exception class thrown when opening file after Dir.chdir The logic to handle a missing file was doing additional tests of the given path, but did not consider a changed cwd. Fixed to test cwd + path instead. :100644 100644 f47c263... 58ff365... M src/org/jruby/RubyFile.java