KI_COMPFILE

Compress a file

Synopsis:
CALL KI_COMPFILE srcfile$, dstfile$ TO status, [size]
'ki_compfile( srcfile$, [dstfile$], size )
ArgumentEnumerationPurpose
srcfile$Name of source file to compress
dstfile$Name of target file
statusKDB_ERROR_ENUMReturn status
sizeSize of the compressed file
>KI_COMPFILE

KI_COMPFILE

This compresses a file using the same algorithm as the Unix utility compress working with a 16 bit dictionary. The file can be uncompressed later with KI_DCOMPFILE or the Unix uncompress command.

If the dstfile$ parameter is blank, then the filename of the compressed file will be srcfile$ with a .Z suffix appended. The original file will be removed, if the file was successfully compressed. This mimics the behaviour of

$ compress myfile

If dstfile$ is not blank, then this value will be is used to name the compressed file. The original file, srcfile$, will not be removed, this emulates

$ cat myfile | compress -c > compressedFile

The size of the compressed file is stored in the optional size parameter.

History
Introduced in KCML 6.20
See Also:
IP_TOS, KI_AES_DECRYPT, KI_AES_ENCRYPT, KI_COMP, KI_CRYPT, KI_DCOMP, KI_DCOMPFILE, KI_DES_DECRYPT, KI_DES_ENCRYPT, KI_DF, KI_DFK, KI_DIR, KI_DIR_LIST, KI_DS, KI_MD5, KI_PID, KI_PMATCH, KI_SHA1, KI_SIZE, KI_STAT, KI_STATFS, KI_TOUCH, R7_DATE2J, R7_J2DATE
KCML database status codes