Skip to content

uninitialized constant File::FNM_EXTGLOB since latest release 1.2.1 with Ruby 1.9 #317

Closed
@joerg

Description

@joerg

Hi,

We are getting an error when using glob from a zipfile with the latest release 1.2.1. Here is how to reproduce the error:

# cd /tmp
# touch test.txt
# zip test.zip test.txt
  adding: test.txt (stored 0%)
# zipinfo test.zip
Archive:  test.zip
Zip file size: 166 bytes, number of entries: 1
-rw-r--r--  3.0 unx        0 bx stor 17-Feb-09 11:58 test.txt
1 file, 0 bytes uncompressed, 0 bytes compressed:  0.0%

# jruby -v
jruby 1.7.19 (1.9.3p551) 2015-01-29 20786bd on Java HotSpot(TM) 64-Bit Server VM 1.6.0_45-b06 +jit [linux-amd64]
# jirb -v
irb 0.9.6(09/06/30)
# jirb 

And there call:

require 'zip'

Zip::File.open('test.zip', nil) { |zipfile|
    zipfile.glob('test.txt')
}

The error is:

NameError: uninitialized constant File::FNM_EXTGLOB
        from org/jruby/RubyModule.java:2726:in `const_missing'
        from /opt/jruby-1.7.19/lib/ruby/gems/shared/gems/rubyzip-1.2.1/lib/zip/file.rb:354:in `glob'
        from (irb):16:in `evaluate'
        from /opt/jruby-1.7.19/lib/ruby/gems/shared/gems/rubyzip-1.2.1/lib/zip/file.rb:101:in `open'
        from (irb):15: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 /opt/jruby-1.7/bin/jirb:13:in `(root)'

Using Ruby 2.3 the same test works, using Ruby 1.9.3 I do get the same error (both not JRubies). My guess is that renaming the Class to File from ZipFile gives resolution errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions