-
-
Notifications
You must be signed in to change notification settings - Fork 3
PKZip.WriteZip
Andrew Lambert edited this page May 18, 2021
·
8 revisions
PKZip.WriteZip
Protected Function WriteZip(ToArchive() As FolderItem, OutputFile As FolderItem, RelativeRoot As FolderItem, Overwrite As Boolean = False, CompressionLevel As Integer = zlib.Z_DEFAULT_COMPRESSION) As Boolean
Protected Function WriteZip(ToArchive As FolderItem, OutputFile As FolderItem, Overwrite As Boolean = False, CompressionLevel As Integer = zlib.Z_DEFAULT_COMPRESSION) As Boolean
Name | Type | Comment |
---|---|---|
ToArchive | FolderItem array | A list of files and folders to be archived. |
OutputFile | FolderItem | The archive file. |
RelativeRoot | FolderItem | Optional. The root of the directory structure to recreate in the archive. |
Overwrite | Boolean | Optional. If True then the OutputFile is overwritten if it exists. |
CompressionLevel | Integer | Optional. A number between 1 and 9 controlling how aggressive the compression should be (or 0 for no compression). |
Name | Type | Comment |
---|---|---|
ToArchive | FolderItem | The directory to be recursively archived. |
OutputFile | FolderItem | The archive file. |
Overwrite | Boolean | Optional. If True then the OutputFile is overwritten if it exists. |
CompressionLevel | Integer | Optional. A number between 1 and 9 controlling how aggressive the compression should be (or 0 for no compression). |
Returns True
if the operation was successful.
Creates the OutputFile
as a Zip archive containing the files specified by ToArchive
.
This example creates a new zip archive by recursively compressing a directory structure:
Dim zipfile As FolderItem = GetSaveFolderItem("", "output.zip") ' the zip file
Dim target As FolderItem = SelectFolder() ' the target folder
If Not PKZip.WriteZip(target, zipfile) Then MsgBox("Zip error!")
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2014-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.