Skip to content

File.executable? raises an exception if the file_path is non-existent and native disabled #2297

@rtyler

Description

@rtyler
jruby-1.7.15 :001 > File.executable? '/tmp/not-a-thing'
File.executable? '/tmp/not-a-thing'
 => false 
jruby-1.7.15 :002 > 
1.9.3-p484 :001 > File.executable? '/tmp/not-a-thing'
 => false 
1.9.3-p484 :002 > 

And of course, on JRuby 1.7.17:

jruby-1.7.17 :001 > File.executable? '/tmp/not-a-thing'
Errno::ENOENT: No such file or directory - /tmp/not-a-thing
    from org/jruby/RubyFileTest.java:100:in `executable?'
    from (irb):1:in `evaluate'
    from org/jruby/RubyKernel.java:1107:in `eval'
    from org/jruby/RubyKernel.java:1507:in `loop'
    from org/jruby/RubyKernel.java:1270:in `catch'
    from org/jruby/RubyKernel.java:1270:in `catch'
    from /home/tyler/.rvm/rubies/jruby-1.7.17/bin/irb:13:in `(root)'
jruby-1.7.17 :002 > 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions