p7z_zipΒΆ

p7z_zip creates a ZIP or 7z archive.

ret = p7z_zip(ssZipFile, ssRootDirectory, svFiles)
ret = p7z_zip(ssZipFile, ssRootDirectory, svFiles, svOptions)

Return Value

ret is 0, if the function was successful. In case of an error the function returns an error object (see error_create).

Parameters

ssZipFile

ssZipfile is the complete file name of the ZIP or 7z file.

ssRootDirectory

Before the function is executed the ssRootDirectory is activated. The parameter must contain a valid path.

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.

svOptions

svOptions is a string vector with addional options. A complete list of options can be found in the file <uniplot>\program\7zip. Example:

“-pMyPassword” Sets a password (“MyPassword”).
“-mem=AES256” (Only zip format). Uses AES256 encryption.
“-mhe=on” (Only 7z files). Encrypt headers (file names etc. .)

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 <uniplot>\program\7zip folder.

See also: http://en.wikipedia.org/wiki/7-Zip und http://www.7-zip.org/.

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"]);

History

Version Description
R2013.10 New.

id-1889706