Skip to content

Zip::InputStream reads only first file on some zip files #227

@lluis

Description

@lluis

Hi,
on some zip files Zip::InputStream reads only the first file:

require 'zip'

Zip::File.open('b.zip') do |io|
  io.each do |entry|
    puts "Entry: #{entry.name}"
  end
end

# output:
# Entry: 1_factura_14277089822133838.pdf
# Entry: B632761741427708982713.pdf
# Entry: factura_14277089822133838.xsig
# Entry: RespuestaWS.xml

Zip::InputStream.open(StringIO.new(File.read('b.zip'))) do |io|
  while (entry = io.get_next_entry)
    puts "Entry: #{entry.name}"
  end
end

# output:
# Entry: 1_factura_14277089822133838.pdf

here is the zip example:

https://gist.github.com/lluis/bed8caa5cbccc58d47ac/raw/cb9b4db0289c0018542df72148e752f8dd13aa77/b.zip

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