ZipCreate

Creates a ZIP archive, in preparation of compressing files to it. The archive may be created on disk, or in memory, or be spooled to an open pipe.

Synopsis

error = ZipCreate(VariableName, Location, Option, Password)

Args

VariableName is the name of some variable where you would like a ZIP handle (to this particular archive) stored. This handle will need to be passed to other RxZip functions. If you're passing the variable name directly, remember to quote it.

Location depends upon the value of Option.

Option is one of the following:

Option Meaning
'FILE' The ZIP archive is created on disk. Location is the full pathname of the file to be created.
'MEMORY' The ZIP archive is created in memory. Location is the maximum size to which the ZIP archive can grow. See ZipGetMemory also.
'PIPE' The ZIP archive is to be spooled to a pipe, or written to an already open file. Location is the handle of the pipe/file.

If omitted, Option defaults to "FILE".

If you want password encryption, then Password your password string. Otherwise, omit this arg for no encryption.

Returns

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

Notes

After you're finished with the ZIP archive, you must pass the ZIP handle to ZipClose.