IPWorks ZIP 2020 Python Edition

Questions / Feedback?

extract_to_path Property

A base path to decompress to.

Syntax

def get_extract_to_path() -> str: ...
def set_extract_to_path(value: str) -> None: ...

extract_to_path = property(get_extract_to_path, set_extract_to_path)

Default Value

""

Remarks

Setting the extract_to_path property affects the operation of the extract and extract_all methods. Setting this property to a nonempty string will cause all decompressed files to be written to the specified path. If pathnames are given in the values of file_decompressed_name they will be regarded as relative to extract_to_path.

If the specified directory does not exist, it will be created when extraction is done.

extract_to_path should always be specified in the format native to the host operating system, and with a trailing slash or backslash. If the path is specified otherwise, it will be immediately converted and stored in the converted format. For example, "/temp" would be immediately converted to "\temp\" on a Windows system.

Example (Extracting from an Archive)


ZipControl.ArchiveFile = "c:\temp.zip"
ZipControl.ExtractToPath = "c:\extracted\"
ZipControl.ExtractAll()

Example - Adding Files

Dim i as Integer
ZipControl.ArchiveFile = "c:\test.zip"
ZipControl.Scan()
For i = 0 to ZipControl.Files.Count - 1
  ZipControl.Files(i).DecompressedName(i) = "c:\temp\" + ZipControl.Files(i).DecompressedName
Next i
ZipControl.ExtractToPath = ""
ZipControl.ExtractAll()
ZipControl.IncludeFiles("c:\extra\*")
ZipControl.Compress()

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks ZIP 2020 Python Edition - Version 20.0 [Build 8300]