Zip:isdirectory(path) method

Check if the entry with the given path/name in the Zip archive represents a directory. The Zip archive should have been previously opened in "read" mode.

Parameters

path

A string representing the path and/or the name of the entry in the Zip archive.

Return value

Returns true if the given entry is a directory, false otherwise.

Example

-- checks if an entry from a zip archive is a directory local compression = require "compression" -- check parameters : the archive and entry specified as argument local archive = arg[1] or error("no archive specified") local entry = arg[2] or error("no entry specified") -- open the archive local z = compression.Zip(archive) -- check the entry local result = z:isdirectory(entry) and " is " or " is not " print(entry.." from "..archive..result.."a directory") print(entry.." from "..archive..result.."a directory")