Arbortext Command Language > Functions by Alphabetical Listing > zip_extract
  
zip_extract
zip_extract (zippath, outdir[, flags])
This function expands the given zip file into the specified output directory. Whether any existing files are automatically overwritten is under control of the optional flags parameter. This function does not remove any existing files from the output directory, but may overwrite some of them in some cases. If you want the output directory to be empty before expanding the zip file, then you must do that before calling this function.
The zippath parameter is a full path to a zip file or resource. Both file system and HTTP or HTTPS paths are supported.
The outdir parameter is a full path to an existing file system directory. An HTTP path is not supported.
The flags parameter supports the following bits:
0x01 — Will attempt to overwrite any existing files during extraction. If not set, the function call will fail and not overwrite any pre-existing file. Note that this will not overwrite read-only files.
0x02 — Will ignore any directory information encoded inside the zip file and just extract all files into the output directory itself. That is, it will flatten any existing directory structure.
0x04 — The same as 0x01, but will attempt to overwrite even read-only files.
The function returns non-zero on success and zero on failure. On failure, main::ERROR will be setup with an appropriate error message. On failure, some files might have already been extracted. Any such files will be left alone.