.. highlightlang:: us .. index:: p7z_zip .. _p7z_zip: p7z_zip ======= .. us.tag p7z_zip NOTREADYENGLISH file-zip New5510 :ref:`p7z_zip` creates a ZIP or 7z archive. .. function:: ret = p7z_zip(ssZipFile, ssRootDirectory, svFiles) ret = p7z_zip(ssZipFile, ssRootDirectory, svFiles, svOptions) .. us.return **Return Value** *ret* is 0, if the function was successful. In case of an error the function returns an error object (see :ref:`error_create`). .. us.params **Parameters** .. uparam:: ssZipFile *ssZipfile* is the complete file name of the ZIP or 7z file. .. uparam:: ssRootDirectory Before the function is executed the *ssRootDirectory* is activated. The parameter must contain a valid path. .. uparam:: svFiles *svFiles* is a string vector with file and directory names. The elements may contain wildcards. The directories can contain an absolute path (e. g. ``d:\a\b``) or a relative path to *ssRootDirectory*. The given path is saved in the archive. .. uparam:: svOptions *svOptions* is a string vector with addional options. A complete list of options can be found in the file ``\program\7zip``. Example: .. list-table:: * - "-pMyPassword" - Sets a password ("MyPassword"). * - "-mem=AES256" - (Only zip format). Uses AES256 encryption. * - "-mhe=on" - (Only 7z files). Encrypt headers (file names etc. .) .. us.comment **Comment** The function uses the "7-Zip Command Line Version". The program (``7za.exe``), the license and the documentation (``7-zip.chm``) can be found in ``\program\7zip`` folder. See also: http://en.wikipedia.org/wiki/7-Zip und http://www.7-zip.org/. .. us.example **Example** :: p7z_zip("d:\\test.zip", "c:\\uniplot", ["program", "script"]); :: p7z_zip("d:\\test.zip", "c:\\uniplot", ["program", "script"], "-pMyPassword"); :: p7z_zip("d:\\test.zip", "c:\\uniplot", ["program", "script"], "-pMyPassword -mem=AES256"); :: p7z_zip("d:\\test.7z", "c:\\uniplot", ["program", "script"]); .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - R2013.10 - New. .. seealso:: :ref:`file-zip`, :ref:`p7z_unzip`, :ref:`p7z_unzip_buffer`, :ref:`p7z_list` :sub:`id-1889706`