History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRUBY-2289
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: David Koontz
Votes: 0
Watchers: 1
Operations

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

File.directory? returns false for directories inside a jar

Created: 17/Mar/08 04:47 PM   Updated: 26/Aug/08 02:06 PM
Component/s: Java Integration
Affects Version/s: JRuby 1.1
Fix Version/s: None

Time Tracking:
Not Specified

Environment: JRuby head, OSX 10.5


 Description  « Hide
This code is located in a .rb file that is bundled up along with some subdirectories into a jar file.

Dir.glob(File.expand_path(File.dirname(_FILE_) + "/**")).each do |directory|
$LOAD_PATH << directory if File.directory?(directory) # always false
end

My workaround is to check for the presence of a file extension which works for my specific case but is obviously not a good general purpose workaround.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Charles Oliver Nutter - 26/Aug/08 02:02 AM
I think Ola made some fixes since this bug was filed. Can you confirm on trunk that this is still a problem?

David Koontz - 26/Aug/08 02:06 PM
Yes this is still happening to me.

Dir.glob(File.expand_path(File.dirname(_FILE_) + "/**")).each do |directory|
puts "Directory: #{directory.gsub("file:", "")}, File.directory? #{File.directory? directory.gsub("file:", "")}"
end

Directory: /Users/david/dev/projects/hcs/jotbot/package/deploy/JotBot.jar!/src/about, File.directory? false
Directory: /Users/david/dev/projects/hcs/jotbot/package/deploy/JotBot.jar!/src/application_controller.rb, File.directory? false
Directory: /Users/david/dev/projects/hcs/jotbot/package/deploy/JotBot.jar!/src/application_view.rb, File.directory? false
Directory: /Users/david/dev/projects/hcs/jotbot/package/deploy/JotBot.jar!/src/category.rb, File.directory? false
Directory: /Users/david/dev/projects/hcs/jotbot/package/deploy/JotBot.jar!/src/category_editor, File.directory? false
...etc...