UnixCompress AutoIt Reference Documentation

UnixCompress

Current Version: 11.6.0

Chilkat.UnixCompress

Compress, uncompress, and unpack legacy UNIX .Z files.

Chilkat.UnixCompress provides UNIX compress and uncompress functionality for legacy .Z files. It supports file-based, memory-based, and string-based workflows, uses LZW compression, can unpack .tar.Z archives, and includes abort and progress-related support for longer-running operations.

Compress to .Z

Compress files, memory data, or strings into UNIX .Z format using LZW compression.

Uncompress .Z data

Expand UNIX-compressed data back to files, memory, byte arrays, or text depending on the application workflow.

File workflows

Compress and uncompress directly between input and output files when working with existing filesystem data.

Memory workflows

Work with compressed or uncompressed byte data in memory when temporary files are not desired.

String workflows

Compress and uncompress text using an explicit character set so string data round-trips correctly.

Unpack tar.Z archives

Use UnTarZ to decompress and extract legacy .tar.Z archives in a single workflow.

Common pattern: Use UnixCompress when the data is in classic UNIX .Z format or when a .tar.Z archive must be unpacked. Use Chilkat.Gzip for .gz and .tar.gz files, Chilkat.Bz2 for .bz2 files, and Chilkat.Compression for raw compression algorithms and general-purpose compression workflows.

Object Creation

Local $oUnixCompress = ObjCreate("Chilkat.UnixCompress")

Register the 32-bit or 64-bit Chilkat ActiveX to match the AutoIt interpreter running the script (AutoIt3.exe or AutoIt3_x64.exe). To bind to a specific major version of Chilkat, append the major version number to the ProgID, such as ObjCreate("Chilkat.UnixCompress.11") for Chilkat v11.*.*.

Boolean properties and arguments are integers in the ActiveX (1 or 0); AutoIt's True and False convert to them automatically. A method that fails to return an object returns Null. Methods and properties that pass or return raw byte arrays are not shown on this page; use the BinData-based alternatives (methods ending in Bd) or the base64 / hex string-encoded variants instead.

Properties

AbortCurrent
AbortCurrent ; Boolean
Introduced in version 9.5.0.58

When set to True, causes the currently running method to abort. Methods that always finish quickly (i.e.have no length file operations or network communications) are not affected. If no method is running, then this property is automatically reset to False when the next method is called. When the abort occurs, this property is reset to False. Both synchronous and asynchronous method calls can be aborted. (A synchronous method call could be aborted by setting this property from a separate thread.)

top
DebugLogFilePath
DebugLogFilePath ; String

If set to a file path, this property logs the LastErrorText of each Chilkat method or property call to the specified file. This logging helps identify the context and history of Chilkat calls leading up to any crash or hang, aiding in debugging.

Enabling the VerboseLogging property provides more detailed information. This property is mainly used for debugging rare instances where a Chilkat method call causes a hang or crash, which should generally not happen.

Possible causes of hangs include:

  • A timeout property set to 0, indicating an infinite timeout.
  • A hang occurring within an event callback in the application code.
  • An internal bug in the Chilkat code causing the hang.

More Information and Examples
top
LastErrorHtml
LastErrorHtml ; String (read-only)

Provides HTML-formatted information about the last called method or property. If a method call fails or behaves unexpectedly, check this property for details. Note that information is available regardless of the method call's success.

top
LastErrorText
LastErrorText ; String (read-only)

Provides plain text information about the last called method or property. If a method call fails or behaves unexpectedly, check this property for details. Note that information is available regardless of the method call's success.

top
LastErrorXml
LastErrorXml ; String (read-only)

Provides XML-formatted information about the last called method or property. If a method call fails or behaves unexpectedly, check this property for details. Note that information is available regardless of the method call's success.

top
LastMethodSuccess
LastMethodSuccess ; Boolean

Indicates the success or failure of the most recent method call: True means success, False means failure. This property remains unchanged by property setters or getters. This method is present to address challenges in checking for null or Nothing returns in certain programming languages. Note: This property does not apply to methods that return integer values or to boolean-returning methods where the boolean does not indicate success or failure.

top
LastStringResult
LastStringResult ; String (read-only)

In SQL Server stored procedures, this property holds the string return value of the most recent method call that returns a string. It is accessible only when Chilkat.Global.KeepStringResult is set to TRUE. SQL Server has limitations on string lengths returned from methods and properties, but temp tables can be used to access large strings.

top
LastStringResultLen
LastStringResultLen ; Integer (read-only)

The length, in characters, of the string contained in the LastStringResult property.

top
VerboseLogging
VerboseLogging ; Boolean

If set to True, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. The default value is False. Verbose logging should only be used for debugging. The potentially large quantity of logged information may adversely affect peformance.

top
Version
Version ; String (read-only)

Version of the component/library, such as "10.1.0"

More Information and Examples
top

Methods

CompressFile
CompressFile($sInFilename, $sDestPath) ; returns Boolean

Compresses a file to create a UNIX compressed file (.Z). This compression uses the LZW (Lempel-Ziv-Welch) compression algorithm.

Returns True for success, False for failure.

top
CompressFileAsync (1)
CompressFileAsync($sInFilename, $sDestPath) ; returns ChilkatTask object

Creates an asynchronous task to call the CompressFile method with the arguments provided.

Returns Null on failure

top
CompressStringToFile
CompressStringToFile($sInStr, $sCharset, $sDestPath) ; returns Boolean

Unix compresses and creates a .Z file from string data. The charset specifies the character encoding used for the byte representation of the characters when compressed. The charset can be any one of a large number of character encodings, such as utf-8, iso-8859-1, Windows-1252, ucs-2, etc.

Returns True for success, False for failure.

More Information and Examples
top
LoadTaskCaller
LoadTaskCaller($oTask) ; returns Boolean
Introduced in version 9.5.0.80

Loads the caller of the task's async method.

Returns True for success, False for failure.

top
UncompressFile
UncompressFile($sInFilename, $sDestPath) ; returns Boolean

Uncompresses a .Z file. (This compression uses the LZW (Lempel-Ziv-Welch) compression algorithm.)

Returns True for success, False for failure.

top
UncompressFileAsync (1)
UncompressFileAsync($sInFilename, $sDestPath) ; returns ChilkatTask object

Creates an asynchronous task to call the UncompressFile method with the arguments provided.

Returns Null on failure

top
UncompressFileToString
UncompressFileToString($sZFilename, $sCharset) ; returns String

Uncompresses a .Z file that contains a text file. The contents of the text file are returned as a string. The character encoding of the text file is specified by charset. Typical charsets are iso-8859-1, utf-8, windows-1252, shift_JIS, big5, etc.

Returns Null on failure

More Information and Examples
top
UncompressFileToStringAsync (1)
UncompressFileToStringAsync($sZFilename, $sCharset) ; returns ChilkatTask object

Creates an asynchronous task to call the UncompressFileToString method with the arguments provided.

Returns Null on failure

top
UnTarZ
UnTarZ($sZFilename, $sDestDir, $bNoAbsolute) ; returns Boolean

Unpacks a .tar.Z file. The decompress and untar occur in streaming mode. There are no temporary files and the memory footprint is constant (and small) while untarring.

Returns True for success, False for failure.

top
UnTarZAsync (1)
UnTarZAsync($sZFilename, $sDestDir, $bNoAbsolute) ; returns ChilkatTask object

Creates an asynchronous task to call the UnTarZ method with the arguments provided.

Returns Null on failure

top