Zip (compress files)

function Zip(what, zipArchive, password: string): boolean;

The Zip function creates a compressed (zip) archive with the files that are passed to it in the what argument (supports wildcards). If the destination zip archive already exists it will be overwritten and replaced.

This function accepts the following parameters:

Parameter Type Requirement Explanation
what string required must be a valid and existing path or a wildcard path
zipArchive string required fully qualified path to the zip archive to be created
password string optional if this is not empty the zip archive will be encrypted

Possible return values:

Value Explanation
true the function succeeded: the zip archive was created
true the function failed: the zip archive was not created

Example

{
  Zip('./documents/*.docx', './archives/dox.zip');
}