Issue Details (XML | Word | Printable)

Key: JRUBY-1368
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Thomas E Enebo
Reporter: Alexey Verkhovsky
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
JRuby

Attempting File.open('foo', 'w') when './foo' is a directory raises Errno:ERNOENT, but should raise Errno:EISDIR

Created: 17/Sep/07 10:47 AM   Updated: 22/Dec/07 06:28 AM   Resolved: 29/Oct/07 12:28 PM
Component/s: Miscellaneous
Affects Version/s: None
Fix Version/s: JRuby 1.0.2, JRuby 1.1b1

Time Tracking:
Not Specified

File Attachments: 1. Text File jruby-1368.jruby-1_0.patch (4 kB)
2. Text File jruby-1368.patch (4 kB)

Environment: JRuby rev 4334


 Description  « Hide
  • MRI *
    alexeyv@alexeyv-laptop:~$ ruby -e "File.open('./foo', 'w') { |f| 1000.time f.puts 'quick brown fox' }"
    -e:1: warning: parenthesize argument(s) for future version
    -e:1:in `initialize': Is a directory - ./foo (Errno::EISDIR)
    from -e:1:in `open'
    from -e:1


    *JRuby *
    alexeyv@alexeyv-laptop:~$ jruby -e "File.open('./foo', 'w') { |f| 1000.time f.puts 'quick brown fox' }"
    -e:1 warning: parenthesize argument(s) for future version
    -e:1:in `open': File not found (Errno::ENOENT)

Note the wrong error (file not found makes no sense for File.open with 'w' flag)



Charles Oliver Nutter added a comment - 19/Oct/07 09:04 PM

I'll fix it if you provide a neat test case for it....


Charles Oliver Nutter added a comment - 19/Oct/07 09:15 PM

Enebo fixed this on trunk, but the patch won't cleanly apply to 1.0 branch. How badly do you want it?


Riley Lynch added a comment - 27/Oct/07 06:12 PM

Patch cleaned up for jruby-1_0 branch


Thomas E Enebo added a comment - 29/Oct/07 12:28 PM

Patch applied on 1.0 branch in commit 4781. Already fixed on trunk.