Module xw.zip
ZIP builder/reader
Usage:
local zip = require 'xw.zip'
Type xw.zip
xw.zip.create(zipFile, fileList, options) |
|
Type xw.zip
Field(s)
- xw.zip.create(zipFile, fileList, options)
-
Create a Zip file with a set of files
Parameters
#string zipFile
: The Zip file to create. The file is removed if existing.#table fileList
:A matrix of tables of real filenames and zip file names (the name the file will have inside the zip file)
The file list content should be as follows: { { filePath="c:\mydir\myfile.log", destArcPath = "myfile.log" }, { filePath="c:\mydir\myfile.log.1", destArcPath = "myfile1.log" }, { filePath="c:\mydir\myfile.log.2", destArcPath = "myfile2.log" }, { filePath="c:\another_dir\readme", destArcPath = "some_other_stuff\readme.txt" } } The examples shows who the first name (filePath) must be the real file name while the second one (destArcPath) is the name the file will have once put into the zip file.
#table options
: A table of parameters (actually unused)
Return value
#boolean: True or false (success or failure)