Skip to content

PKZip.ZipWriter.AppendDirectory

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

PKZip.ZipWriter.AppendDirectory

Method Signature

      Sub AppendDirectory(Entry As FolderItem, RelativeRoot As FolderItem = Nil)
 Function AppendDirectory(Entry As FolderItem, RelativeRoot As FolderItem = Nil) As String

Parameters

Name Type Comment
Entry FolderItem The directory to append to the archive.
RelativeRoot FolderItem Optional. The root directory of the archive (see remarks).

Return value

The version that returns a value returns the path of the added directory within the archive. If the RelativeRoot parameter is not specified then then the return value is the empty string.

Remarks

Recursively adds the directory represented by the Entry parameter to the archive. If RelativeRoot is specified then files/subdirectories are stored in the archive using paths relative to RelativeRoot. If RelativeRoot is not specified then all files/subdirectories are added to the archive root directly.

For example, assume you have a directory with four items:

Root
 |-SubDir
   |-File1
   |-File2
   |-File3

Calling AppendDirectory(SubDir) will add File1, File2, and File3 to the root of the zip archive. Calling AppendDirectory(SubDir, Root) will add a directory, named "Subdir" and containing the three files, to the root of the zip archive.

See also

Entry-level points of interest denoted by "☜"



Clone this wiki locally