# Zip / Unzip

This function can zip the contents of a folder to a file or it can unzip a file to a folder.

When zipping, the process is not deep. Folders in the specified folder are not included and path information is not included in the zip file. A preexisting copy of the zip file will be deleted.

When unzipping, the folder will be created if it does not exist. Preexisting items in the folder with the same name as an item in the zip file will be overwritten.

Both file paths must be absolute (begin with a / character). If the zip file specification does not end with .zip, it will be appended.

The text fields may contain any of the escape sequences described in Escape Sequences.

Regardless of the execution mode, the function is only executed once.

The action test state is set to true if the operation works, otherwise false. When set to false the Data Source Access Error named variable will be set as follows:

1
  error launching the script
2
  error removing preexisting zip file (Zip)
3
  source folder does not exist or is a file (Zip)
4
  nothing to zip (Zip)
5
  the zip file exists and is a folder (Zip)
6
  the destination folder is a file (Unzip)
7
  the zip file's path is not absolute
8
  the source folder's path is not absolute
9
  zip file does not exist or is a folder (Unzip)
A negative integer
  a negated zip or unzip error code.