IPWorks ZIP 2020 Python Edition

Questions / Feedback?

archive_file Property

The name of the zip, gzip, tar, or jar archive.


def get_archive_file() -> str: ...
def set_archive_file(value: str) -> None: ...

archive_file = property(get_archive_file, set_archive_file)

Default Value



This property specifies the name of the archive to be read or written. This property is required when extracting files.

When scan, extract, or extract_all is invoked, the file specified by archive_file will be opened for read. If the file does not exist, a trappable error will be generated.

When compress is called, the file named by archive_file will be written; if a file of this name already exists the on_overwrite event will be fired. If archive_file is set to the empty string (""), the archive will not be written to disk, and will be provided only through the on_progress event.

The filename may be specified with or without a path. Paths may be relative or absolute, and should be specified in the format native to the host operating system. The filename should be specified with the appropriate extension (such as "zip"); an extension will not automatically be appended by the class.

If the file cannot be read, or written, as appropriate, a trappable error will be generated.

Example (Creating an Archive)

ZipControl.ArchiveFile = "c:\test.zip"
ZipControl.RecurseSubdirectories = true

Note: an archive already open for read may be closed by setting archive_file to the empty string ("").

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