Skip to content
Andrew Lambert edited this page Nov 26, 2022 · 8 revisions

PKZip.ReadZip

Method Signature

 Protected Function ReadZip(ZipFile As FolderItem, ExtractTo As FolderItem, Overwrite As Boolean = False, VerifyCRC As Boolean = True) As FolderItem()

Parameters

Name Type Comment
ZipFile FolderItem The archive file to read.
ExtractTo FolderItem The directory to extract into.
Overwrite Boolean Optional. If True, existing files in the ExtractTo directory will be overwritten.
VerifyCRC Boolean Optional. If True, the CRC32 checksum of each file will be verified.

Return value

An array of zero or more FolderItems corresponding to the extracted files & directories.

Remarks

This method extracts the specified zip archive into the output directory. The directory structure of the archive is preserved and missing subdirectories of the target directory will be created automatically.

The zip archive format does not forbid having two or more entries with identical names. If Overwrite is False (the default), then an IOException will be raised when a duplicate entry is encountered. If Overwrite is True then no exception is raised and each subsequent duplicate overwrites the previous one. To correctly process an archive with duplicate entries use the ZipReader class.

Example

  Dim src As FolderItem = GetOpenFolderItem("") ' a zip archive file
  Dim dst As FolderItem = SelectFolder() ' the folder to extract into
  Dim list() As FolderItem = PKZip.ReadZip(src, dst)

See also

Entry-level points of interest denoted by "☜"



Clone this wiki locally