IPWorks ZIP 2020 Python Edition

Questions / Feedback?

on_overwrite Event

Fired whenever a file exists and may be overwritten.

Syntax

class ZCompressOverwriteEventParams(object):
  @property
  def filename() -> str: ...
  @filename.setter
  def filename(value) -> None: ...
  @property
  def overwrite() -> bool: ...
  @overwrite.setter
  def overwrite(value) -> None: ...

# In class ZCompress:
@property
def on_overwrite() -> Callable[[ZCompressOverwriteEventParams], None]: ...
@on_overwrite.setter
def on_overwrite(event_hook: Callable[[ZCompressOverwriteEventParams], None]) -> None: ...

Remarks

on_overwrite is fired when a file is about to be overwritten, and would overwrite an existing file. The event is fired during decompression.

Filename contains the full name of the file, specified with its pathname.

Overwrite specifies whether or not the file will be overwritten. For Zip, Jar, and Tar, this is equal by default to the value of the overwrite_files property. For Gzip, this value defaults to true.

Either of the parameters may be changed when the event is fired. Changing the value of Overwrite will override the default behavior of the class, and cause the file to be overwritten or not overwritten, depending on the value set. If Filename is changed, the value of Overwrite will be ignored, and the file will be written with the specified name. If a file of the new name also exists this file will be silently overwritten.

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