IPWorks ZIP 2020 Node.js Edition

Questions / Feedback?

UseGzipCompression Property

Whether or not to use gzip compression.

Syntax

 tar.getUseGzipCompression([callback])
 tar.setUseGzipCompression( useGzipCompression, [callback])

Default Value

FALSE

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for the getUseGzipCompression([callback]) method is defined as:

function(err, data){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'data' is the value returned by the method.

The callback for the setUseGzipCompression([callback]) method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

If this property is set to true, the class will operate on tar archives that have been compressed with gzip. The interface of the component remains the same. During compression, the data will be streamed through a gzip compressor as it is written to the file. During decompression, the class will unzip the data to a temporary tar archive, and then automatically scan or decompress the tar archive.

The creation of the temporary tar file will occur when the Scan method is invoked (note that this method is invoked automatically by Extract and ExtractAll if it is not invoked explicitly by the user). The entire file must be decompressed, so Scan might operate slowly, and the Progress event will be fired as the tar file is extracted. If Scan is invoked automatically by Extract or ExtractAll, the PercentProcessed parameter of the event will increase from 0 to 100 as the archive is decompressed, and again as files are extracted from the temporary file.

The temporary file will automatically be deleted by the class after it is no longer needed. To extract the tar file itself (rather than its contents), the Gzip class should be used.

Due to the nature of the gzip format, Append and Delete are not supported for .tar.gz files.

If this property is set to false, the class will create and read ordinary, uncompressed tar archives.

NOTE: This is not supported when using an input stream for extraction.

Data Type

Boolean

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