Skip to content

Dir.foreach fails in jar files #515

@byteit101

Description

@byteit101

If I package a file with the contents below in a jar file (jruby-complete)

Dir.foreach File.dirname(__FILE__) do |file|
  p file
end

Running it I get the error:

Errno::ENOENT: No such file or directory - No such directory: file:/path/to/the.jar!/
initialize at org/jruby/RubyDir.java:149
foreach at org/jruby/RubyDir.java:527
(root) at classpath:jar-bootstrap.rb:1

It appears Dir.foreach does not like embedded jar paths.
Discovered in this JRubyFX comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions