UnixCompress Tcl Reference Documentation

UnixCompress

Current Version: 10.1.2

UNIX (.Z) compression component.

Object Creation

set myUnixCompress [new CkUnixCompress]

Properties

AbortCurrent
boolean 1/0
set boolVal [CkUnixCompress_get_AbortCurrent $myUnixCompress]
CkUnixCompress_put_AbortCurrent $myUnixCompress $boolVal
Introduced in version 9.5.0.58

When set to 1, 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 0 when the next method is called. When the abort occurs, this property is reset to 0. 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
string
# ckStr is a CkString
CkUnixCompress_get_DebugLogFilePath $myUnixCompress $ckStr
set strVal [CkUnixCompress_get_debugLogFilePath $myUnixCompress]
CkUnixCompress_put_DebugLogFilePath $myUnixCompress $strVal

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
string
# ckStr is a CkString
CkUnixCompress_get_LastErrorHtml $myUnixCompress $ckStr
set strVal [CkUnixCompress_get_lastErrorHtml $myUnixCompress]

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
string
# ckStr is a CkString
CkUnixCompress_get_LastErrorText $myUnixCompress $ckStr
set strVal [CkUnixCompress_get_lastErrorText $myUnixCompress]

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
string
# ckStr is a CkString
CkUnixCompress_get_LastErrorXml $myUnixCompress $ckStr
set strVal [CkUnixCompress_get_lastErrorXml $myUnixCompress]

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
boolean 1/0
set boolVal [CkUnixCompress_get_LastMethodSuccess $myUnixCompress]
CkUnixCompress_put_LastMethodSuccess $myUnixCompress $boolVal

Indicates the success or failure of the most recent method call: 1 means success, 0 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.

top
Utf8
boolean 1/0
set boolVal [CkUnixCompress_get_Utf8 $myUnixCompress]
CkUnixCompress_put_Utf8 $myUnixCompress $boolVal

When set to 1, all "const char *" arguments are interpreted as utf-8 strings. If set to 0 (the default), then "const char *" arguments are interpreted as ANSI strings. Also, when set to 1, and Chilkat method returning a "const char *" is returning the utf-8 representation. If set to 0, all "const char *" return values are ANSI strings.

top
VerboseLogging
boolean 1/0
set boolVal [CkUnixCompress_get_VerboseLogging $myUnixCompress]
CkUnixCompress_put_VerboseLogging $myUnixCompress $boolVal

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

top
Version
string
# ckStr is a CkString
CkUnixCompress_get_Version $myUnixCompress $ckStr
set strVal [CkUnixCompress_get_version $myUnixCompress]

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

More Information and Examples
top

Methods

CompressFile
# inFilename is a string
# destPath is a string
set status [CkUnixCompress_CompressFile $inFilename $destPath]

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

Returns 1 for success, 0 for failure.

top
CompressFileAsync (1)
# returns a CkTask
# inFilename is a string
# destPath is a string
set ret_task [CkUnixCompress_CompressFileAsync $inFilename $destPath]

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

Returns NULL on failure

top
CompressFileToMem
# inFilename is a string
# outData is a CkByteData (output)
set status [CkUnixCompress_CompressFileToMem $inFilename $outData]

Unix compresses a file to an in-memory image of a .Z file. (This compression uses the LZW (Lempel-Ziv-Welch) compression algorithm.)

Returns 1 for success, 0 for failure.

top
CompressFileToMemAsync (1)
# returns a CkTask
# inFilename is a string
set ret_task [CkUnixCompress_CompressFileToMemAsync $inFilename]

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

Returns NULL on failure

top
CompressMemory
# inData is a CkByteData
# outData is a CkByteData (output)
set status [CkUnixCompress_CompressMemory $inData $outData]

Compresses in-memory data to an in-memory image of a .Z file. (This compression uses the LZW (Lempel-Ziv-Welch) compression algorithm.)

Returns 1 for success, 0 for failure.

top
CompressMemToFile
# inData is a CkByteData
# destPath is a string
set status [CkUnixCompress_CompressMemToFile $inData $destPath]

Unix compresses and creates a .Z file from in-memory data. (This compression uses the LZW (Lempel-Ziv-Welch) compression algorithm.)

Returns 1 for success, 0 for failure.

top
CompressString
# inStr is a string
# charset is a string
# outBytes is a CkByteData (output)
set status [CkUnixCompress_CompressString $inStr $charset $outData]

Compresses a string to an in-memory image of a .Z file. Prior to compression, the string is converted to the character encoding specified by charset. 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 1 for success, 0 for failure.

More Information and Examples
top
CompressStringToFile
# inStr is a string
# charset is a string
# destPath is a string
set status [CkUnixCompress_CompressStringToFile $inStr $charset $destPath]

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 1 for success, 0 for failure.

More Information and Examples
top
LoadTaskCaller
# task is a CkTask
set status [CkUnixCompress_LoadTaskCaller $task]
Introduced in version 9.5.0.80

Loads the caller of the task's async method.

Returns 1 for success, 0 for failure.

top
UncompressFile
# inFilename is a string
# destPath is a string
set status [CkUnixCompress_UncompressFile $inFilename $destPath]

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

Returns 1 for success, 0 for failure.

top
UncompressFileAsync (1)
# returns a CkTask
# inFilename is a string
# destPath is a string
set ret_task [CkUnixCompress_UncompressFileAsync $inFilename $destPath]

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

Returns NULL on failure

top
UncompressFileToMem
# inFilename is a string
# outData is a CkByteData (output)
set status [CkUnixCompress_UncompressFileToMem $inFilename $outData]

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

Returns 1 for success, 0 for failure.

top
UncompressFileToMemAsync (1)
# returns a CkTask
# inFilename is a string
set ret_task [CkUnixCompress_UncompressFileToMemAsync $inFilename]

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

Returns NULL on failure

top
UncompressFileToString
# zFilename is a string
# charset is a string
# outStr is a CkString (output)
set status [CkUnixCompress_UncompressFileToString $zFilename $charset $outStr]
set retStr [CkUnixCompress_uncompressFileToString $myUnixCompress $zFilename $charset]

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 1 for success, 0 for failure.

More Information and Examples
top
UncompressFileToStringAsync (1)
# returns a CkTask
# zFilename is a string
# charset is a string
set ret_task [CkUnixCompress_UncompressFileToStringAsync $zFilename $charset]

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

Returns NULL on failure

top
UncompressMemory
# inData is a CkByteData
# outData is a CkByteData (output)
set status [CkUnixCompress_UncompressMemory $inData $outData]

Uncompresses from an in-memory image of a .Z file directly into memory. (This compression uses the LZW (Lempel-Ziv-Welch) compression algorithm.)

Returns 1 for success, 0 for failure.

top
UncompressMemToFile
# inData is a CkByteData
# destPath is a string
set status [CkUnixCompress_UncompressMemToFile $inData $destPath]

Uncompresses from an in-memory image of a .Z file to a file. (This compression uses the LZW (Lempel-Ziv-Welch) compression algorithm.)

Returns 1 for success, 0 for failure.

top
UncompressString
# inCompressedData is a CkByteData
# charset is a string
# outStr is a CkString (output)
set status [CkUnixCompress_UncompressString $inCompressedData $charset $outStr]
set retStr [CkUnixCompress_uncompressString $myUnixCompress $inCompressedData $charset]

Uncompresses from an in-memory image of a .Z file directly to a string. The charset specifies the character encoding used to interpret the bytes resulting from the decompression. 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 1 for success, 0 for failure.

More Information and Examples
top
UnTarZ
# zFilename is a string
# destDir is a string
# bNoAbsolute is a boolean
set status [CkUnixCompress_UnTarZ $zFilename $destDir $bNoAbsolute]

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 1 for success, 0 for failure.

top
UnTarZAsync (1)
# returns a CkTask
# zFilename is a string
# destDir is a string
# bNoAbsolute is a boolean
set ret_task [CkUnixCompress_UnTarZAsync $zFilename $destDir $bNoAbsolute]

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

Returns NULL on failure

top