#include <qziputil.H> void QzipUnzip( Qlg_Path_Name_T * compressedFileName, Qlg_Path_Name_T * dirToPlaceDecompFiles, char * formatName, char * unzipOptions, char * errorStruct)Service Program Name: QZIPUTIL
The QzipUnzip() API will decompress files and directories from a compressed archive ('.zip') file.
Files that are decompressed from a compressed archive file are assigned the coded character set identifier (CCSID) of the job that is invoking the API. However, the CCSID of all files in a directory can be changed using the find QShell utility in conjunction with the setccsid QShell utility. For example, the following QShell command will change the CCSID attribute of all files in directory /mydir, including files in subdirectories, to 819:
find /mydir/* -type f -exec setccsid 819 {} \;
The name of the archive file that is to be decompressed. 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 QzipUnzip().
The directory to place the contents of the 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 QzipUnzip().
The format name to pass the user's options for decompressing an archive file. See UNZIP100 format for a description of this format.
This is a pointer that passes in the user's options to the QzipUnzip() API in UNZIP100 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 decompress an archive file. 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) | Replace option |
Replace option. This option specifies if an existing file needs to replaced or not if a file by the same name already exists in the target path. The possible values are *YES and *NO.
Note: This option only applies to File objects. Directory names are ignored.
Verbose option. This option specifies if verbose messages are to be printed to the standard out when the decompressing an archive file. 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. |