Zip iteration iterable

Zip objects are iterable through the Luart helper function each(), returning two values at each iteration :

  • An entry name as a string.
  • A boolean value indicating wether the current entry is a Directory or not.

Example

-- lists all entries in specified archive local compression = require "compression" -- check parameters : the archive specified as argument local archive = arg[1] or error("no archive specified") -- open the archive local z = compression.Zip(archive) -- #z is equivalent to z.count print(archive.." has a total of "..#z.." entries")