JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-3986

File inconsistency handles file:/// URLs pointing to things inside a JAR

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.3.1
    • Fix Version/s: JRuby 1.7.0.pre1
    • Component/s: HelpWanted
    • Labels:
      None
    • Number of attachments :
      0

      Description

      File.open( "file://path/to/my.jar!/something/inside.txt" ) works (so does read())

      File.mtime( "file://path/to/my.jar!/something/inside.txt" ) throws an ENOENT thinking the inside.txt does not exist.

        Activity

        Hide
        Nick Sieger added a comment -

        File.mtime and some of the file test methods might need a short-circuit for things inside a jar to do what is expected.

        Show
        Nick Sieger added a comment - File.mtime and some of the file test methods might need a short-circuit for things inside a jar to do what is expected.
        Hide
        David Phillips added a comment -

        This breaks Rails 3.2.1 when ActiveSupport is inside a JAR file. It fails trying to load lib/active_support/locale/en.yml via file_update_checker.rb, which first uses File.exists?, then File.mtime (and the latter fails unexpectedly).

        Show
        David Phillips added a comment - This breaks Rails 3.2.1 when ActiveSupport is inside a JAR file. It fails trying to load lib/active_support/locale/en.yml via file_update_checker.rb , which first uses File.exists? , then File.mtime (and the latter fails unexpectedly).
        Hide
        Dmitry Ratnikov added a comment -

        Reproduced and fixed it in pull request: https://github.com/jruby/jruby/pull/142

        Does it look alright?

        PS I'd love JRubyFile to be an interface shared between files loaded via ZipEntry or File. However, that seems like a bit too much work for now.

        Show
        Dmitry Ratnikov added a comment - Reproduced and fixed it in pull request: https://github.com/jruby/jruby/pull/142 Does it look alright? PS I'd love JRubyFile to be an interface shared between files loaded via ZipEntry or File. However, that seems like a bit too much work for now.
        Hide
        Douglas Campos added a comment - - edited

        fixed at commit bad0715

        thank you Dmitry

        Show
        Douglas Campos added a comment - - edited fixed at commit bad0715 thank you Dmitry

          People

          • Assignee:
            Douglas Campos
            Reporter:
            bob mcwhirter
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: