on_before_extract_file Event
Marks the start of extraction of an archived file.
Syntax
class ArchiveReaderBeforeExtractFileEventParams(object): @property def path() -> str: ... @property def file_size() -> int: ... @property def data_source() -> int: ... @data_source.setter def data_source(value) -> None: ... @property def extraction_path() -> str: ... @extraction_path.setter def extraction_path(value) -> None: ... @property def skip() -> bool: ... @skip.setter def skip(value) -> None: ... # In class ArchiveReader: @property def on_before_extract_file() -> Callable[[ArchiveReaderBeforeExtractFileEventParams], None]: ... @on_before_extract_file.setter def on_before_extract_file(event_hook: Callable[[ArchiveReaderBeforeExtractFileEventParams], None]) -> None: ...
Remarks
Subscribe to this event to be notified about the start of extraction of an archived entry. The handler of this event is a good place to tune up the destination media.
The Path parameter indicates the path to the extracted entry in the archive. The FileSize specifies the uncompressed size of the file. Set the by-reference DataSource parameter in accordance with the desired extraction media type:
fdsFile (0) | The data will be saved to a file indicated by the ExtractionPath parameter. You can change the path here. |
fdsStream (1) | The data will be saved into a stream assigned to file_stream property. |
fdsBuffer (2) | The file data will be saved to a buffer and returned via the file_data property. |
Use the Skip parameter to cancel extraction of this file and proceed to the next one.