| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Compresses a file.
SX_FCompress( <cSourceFile>, <cTargetFile> ) --> lSuccess
The function returns .T. (true) when the compressed target file is successfully created, otherwise .F. (false) is returned.
Function SX_FCompress() reads the entire file <cSourceFile> and writes its compressed contents into the new file <cTargetFile>. If <cTargetFile> exists already, it is overwritten without warning.
| See also: | HB_Compress(), SX_FDecompress() |
| Category: | File functions , Six driver |
| Source: | rdd\hbsix\sxcompr.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example compresses a MAP file to demonstrate the size of
// a compressed file.
PROCEDURE Main
LOCAL cSource := "sx_Fcompress.map"
LOCAL cTarget := "sx_Fcompress.cmp"
? FileSize( cSource ) // result: 246331
? SX_FCompress( cSource, cTarget ) // result: .T.
? FileSize( cTarget ) // result: 63286
RETURN
http://www.xHarbour.com