ZipAdd

Adds another entry to the ZIP archive. You can add a file to the archive, the contents of some variable, or data from a pipe or an already open file.

Synopsis

error = ZipAdd(ZipHandle, Location, Option, ZipName)

Args

ZipHandle is the handle returned by ZipCreate().

Location depends upon the value of Option.

Option is one of the following:

Option Meaning
'FILE' The data for the added entry is from a file on disk. Location is the full pathname of that file.
'MEMORY' The data for the added entry is passed directly. Location is that data. This can come from a variable, or the output of another function, etc.
'PIPE' The data for the added entry is from a pipe, or taken from an already open file. Location is the handle of the pipe/file.
'FOLDER' The data for the added entry is the name of a folder. Location is the full pathname of that folder. If you need to recreate an empty directory when the ZIP archive is unzipped, then you'll use the FOLDER option to add the name of that empty directory.

If omitted, Option defaults to "FILE".

ZipName is the desired name to give the entry when it's added to the ZIP archive. Omit this arg for the FOLDER option. For the FILE operation, if you omit this arg, then the entry is given the same name as the original file.

Returns

An empty string if the new entry is successfully added to the ZIP archive, or an error message if not. (If ZipErr is set to "NUM", then 0 is returned for success, or an error number).