ZOPEN(3)

NAME
zopen - open a gzip compressed stream

LIBRARY
libz

SYNOPSIS
FILE *
zopen(const char *path, const char *mode);

DESCRIPTION
The zopen() opens a gzip file whose name is the string pointed to by path and associates a stream with it. It is a wrapper around zlib(3) and standard stream I/O APIs.

The argument mode have the same meaning as it does in fopen(3).

The zopen function will associate read, write, seek and close functions of zlib(3) after successfully opened a file with funopen(3) so that they will be used to read or write the new stream.

RETURN VALUES
Upon successful completion zopen returns a FILE pointer. Otherwise, NULL is returned and the global variable errno is set to indicate the error.

ERRORS
In addition to the errors documented for fopen(3), the zopen function may also fail for:

[ENOMEM]
    Insufficient memory is available.

COMPATIBILITY
This implementation of zopen function first appeared in NetBSD 1.6 and FreeBSD 4.5. The zopen function may not be portable to systems other than FreeBSD.

SEE ALSO
fopen(3), funopen(3), zlib(3)