#include <qziputil.H> void QzipZip( Qlg_Path_Name_T * fileToCompress, Qlg_Path_Name_T * compressedFileName, char * formatName, char * zipOptions, char * errorStruct)Service Program Name: QZIPUTIL
The QzipZip() API will compress files and directories and creates an archive file.
The name of the file or directory that is to be compressed into an archive file. The path name needs to be in Qlg_Path_Name_T structure. For more information see Path name format.
Wild card characters and pattern matching of the path name is not supported.
The only delimiter that is accepted by this API in the Qlg_Path_Name_t structure is a forward slash (/).
The path can be an absolute path name or a relative path name. All relative path names are relative to the current directory at the time of the call to QzipZip().
The name of the compressed archive file. This file is created by the API. The path name needs to be in Qlg_Path_Name_T structure. For more information see Path name format.
Wild card characters and pattern matching of the path name is not supported.
The only delimiter that is accepted by this API in the Qlg_Path_Name_t structure is a forward slash (/).
The path can be an absolute path name or a relative path name. All relative path names are relative to the current directory at the time of the call to QzipZip().
The format name to pass the user's options for compressing a file or a directory to an archive file. See ZIP00100 format for a description of this format.
This is a pointer that passes in the user's options to the QzipZip() API in ZIP00100 format.
This is a pointer to an error code structure to receive error information. See Error code parameter for more information.
The following table shows the format for passing the user's options to compress files or directories. For a detailed description of each field, see Field Descriptions.
Offset | Type | Field | |
---|---|---|---|
Dec | Hex | ||
0 | 0 | CHAR(10) | Verbose option |
10 | A | CHAR(6) | Subtree option |
16 | 10 | CHAR(512) | Comment |
528 | 210 | BINARY(4), UNSIGNED | Length of the comment |
Comment. The contents of the comment parameter in job CCSID is added to the newly created archive file.
Length of the comment. The length of the comment in bytes.
Subtree option. This option specifies whether directory subtrees are included or not when creating an archive file. The following are the possible values.
*ALL - The *ALL subtree option compresses all subdirectories and the objects within those subdirectories.
*NONE - The *NONE option does not compress subdirectories.
In case of a symlink, the API follows the link and compresses the actual file instead of just compressing the symlink.
Verbose option. This option specifies if verbose messages are to be printed to the standard out during the compression process. The following are the possible values.
*VERBOSE - The *VERBOSE option prints verbose messages to the stdout. The system itself does not set up stdin, stdout, stderr descriptors and it is the responsibility of the user of this API to set the descriptors when using the *VERBOSE option. For a detailed description, see File systems.
*NONE - The *NONE option does not print any messages to the stdout.
In addition to the following messages, the API also throws a number of CPF9898 messages that describe what the error is.
CPFA081 | Unable to set return value or error code. |
CPFA08B | Path name cannot begin with *. |
CPFA094 | Path name not specified. |
CPFA09C | Not authorized to object. Object is &1. |
CPFA09E | Object in use. Object is &1. |
CPFA0A3 | Path name resolution causes looping. |
CPFA0A9 | Object not found. Object is &1. |
CPFA0C7 | &1 directory failed to create. |
CPFA0CF | Error occurred determining the current directory. |