on_file_extraction_start Event
Signifies the start of a file extraction process.
Syntax
class ASiCVerifierFileExtractionStartEventParams(object): @property def file_name() -> str: ... @property def file_size() -> int: ... @property def mod_date() -> str: ... @property def dest_file() -> str: ... @dest_file.setter def dest_file(value) -> None: ... # In class ASiCVerifier: @property def on_file_extraction_start() -> Callable[[ASiCVerifierFileExtractionStartEventParams], None]: ... @on_file_extraction_start.setter def on_file_extraction_start(event_hook: Callable[[ASiCVerifierFileExtractionStartEventParams], None]) -> None: ...
Remarks
This event fires for every file located in the archive and matching the extraction_mode setting before it is to be extracted.
DestFile indicates the path where the file will be saved to. You can alter the destination path here, by providing an alternative extraction path.
Set DestFile to an empty string and provide a stream object via the output_stream property if you prefer to save the data to a stream instead of file.
If DestFile is set to an empty string and output_stream is unassigned, the file will not be extracted.
Alternatively, you can request the extracted content to be saved into a byte array. To do this, leave DestFile and output_stream empty, and enable the ExtractToMemory config property. This property is automatically reset before extraction of every subsequent file, and should be re-enabled in the handler of this event.
Please take care when extracting large files into byte arrays, as those may consume large amounts of memory.
Note: if DestFile already exists, the class will overwrite it. To prevent overwriting of existing files, subscribe to this event, and change DestFile when needed.