Zip.async.extractall([dir]) method
Extract on the disk all the content of the Zip archive, asynchronously. The Zip archive should have been previously opened in "read" mode.
Parameters
dir
The destination folder where the entire archive content will be extracted on the disk, as a string or a Directory value.
If omitted, the archive will be extracted in the current folder.
Return value
This function returns a Task executed in background.Once the Task has terminated the entry extraction, it will return the number of extracted entries or false if any error occured. You can check the zip.error property to get the error message.
Example
-- extract an entry from a zip archive
local compression = require "compression"
-- check parameters : the archive and entry specified as argument
local archive = arg[1] or error("no archive specified")
-- open the archive
local z = compression.Zip(archive)
-- extract all the archive on the disk in the current directory, asynchronously or throws an error if false
local extracted = await(z:extractall() or error(z.error))
print(extracted.name.." has been successfully extracted to "..extracted.path)