New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dir.foreach fails in jar files #515

Closed
byteit101 opened this Issue Jan 25, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@byteit101
Member

byteit101 commented Jan 25, 2013

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

@enebo

This comment has been minimized.

Show comment
Hide comment
@enebo

enebo Feb 28, 2013

Member

I remember this issue like it was a month ago :)

Ok here is what I did:

  1. Made a file a.rb containing your snippet
  2. In a collection of other .rb files I created a jar: 'jar cf foo.jar *.rb'
  3. jruby -e "require 'foo.jar'; require 'a'"

This worked fine. Patrick, is there a way you can retest this? I would be really surprised if this was incidentally fixed in the last month so I suspect there is another detail I need to properly reproduce it.

Member

enebo commented Feb 28, 2013

I remember this issue like it was a month ago :)

Ok here is what I did:

  1. Made a file a.rb containing your snippet
  2. In a collection of other .rb files I created a jar: 'jar cf foo.jar *.rb'
  3. jruby -e "require 'foo.jar'; require 'a'"

This worked fine. Patrick, is there a way you can retest this? I would be really surprised if this was incidentally fixed in the last month so I suspect there is another detail I need to properly reproduce it.

@enebo

This comment has been minimized.

Show comment
Hide comment
@enebo

enebo Feb 28, 2013

Member

Ah nevermind. I did something stupid.

Member

enebo commented Feb 28, 2013

Ah nevermind. I did something stupid.

@enebo

This comment has been minimized.

Show comment
Hide comment
@enebo

enebo Mar 4, 2013

Member

Uwe fixed this during the weekend in commit f0e3aa3.

Member

enebo commented Mar 4, 2013

Uwe fixed this during the weekend in commit f0e3aa3.

@enebo enebo closed this Mar 4, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment