gzwrite()
CtrlZlib ia a shared library with functions for data compression. It is based on libz (gzip, gunzip).
The function compresses the content and writes the result into the file path. Path is an absolute file name. If the extension is not ".gz", the extension is added.
Synopsis
int gzwrite(string path, string|blob content);
Parameters
Parameter | Description |
---|---|
path | The content to be compressed. |
content | The parameter the compressed content is written to. |
Return value
Error
Description
The function compresses the content and writes the result into the file path. Path is an absolute file name. If the extension is not ".gz", the extension is added.
Example
Compresses the content of the variable "cont" and writes the result into the file test2.txt
#uses "CtrlZlib"
main()
{
string cont = "Hello this is the second test";
string filPath = "c:/test2.txt";
gzwrite(filPath, cont);
DebugN("Compressed content", filPath);
}
Assignment
File function
Availability
CTRL