Reads maximum "len" bytes from the file "path" into the variable "content". CAUTION Under Solaris a zlib (libz.so) version 1.2.3 is required for the use of the zip functions. Download the zlib version from the internet. |
Synopsis
int gzread(string path, string | blob &content, int len[, int offset]); |
Parameters
Parameter |
Description |
path |
Describes the file. If the file does not end with ".gz", The function adds ".gz" to the file name. |
content |
The function reads the bytes from the file into the variable content. The variable has to be of type string or blob. Anytype and mixed are not allowed. |
len |
The function reads maximum of len compressed bytes. |
offset |
The function reads as of the position offset, the compressed data. |
Return value
Number of bytes the function read. 0 if the function does not read any bytes, -1 in case of an error. |
Error
The function returns -1 in case of errors. |
Description
Reads maximum "len"; bytes from the file "path"; into the variable "content";. |
Example The function gzwrite() compresses the content and writes the result into the file test2.txt. The function gzread() reads 30 bytes from the file test2.txt into the variable tar. |
#uses "CtrlZlib"
|
Member of
File function |
Availability
|
See also
|
V 3.11 SP1
Copyright