UnzipGetItem

Extracts the current item. The item may be extracted to a file on disk, or a REXX variable, or spooled to a pipe or already open file. This is called after you've called UnzipSetCurrentItem to set the current item (within the archive).

Synopsis

error = UnzipGetItem(ZipHandle, Location, Options)

Args

ZipHandle is the handle returned by UnzipOpen.

Location depends upon the value of Option.

Option is one of the following:

Option Meaning
'FILE' The item is extracted to a file on disk. Location is the full pathname of the file.
'MEMORY' The item is extracted to a REXX variable. Location is the name of the variable. Remember to quote it, if passing the name directly to UnzipGetItem.
'PIPE' The item is to be spooled to a pipe, or written to an already open file. Location is the handle of the pipe/file.

If omitted, Option defaults to "FILE".

Returns

An empty string if the item is successfully extracted, or an error message if not. (If ZipErr is set to "NUM", then 0 is returned for success, or an error number).

Notes

You can store the item only once. After you call UnzipGetItem, the current item is automatically reset. In order to store the item again, you need to call UnzipSetCurrentItem again.