The libzio provides with the help the fopencookie(3) extension of the glibc or funopen(3) function known on BSD Systems together with zlib and libbzip2 an interface to read or write gzip/bzip2 files with streams. Beside handling gzip, bzip2 and lzma files, the libzio provides support for reading ``.Z'' compressed files. Libzio uses the GNUC weak facility to allow programs to be linked against zlib, libbzip2 or liblzmadec only.
For writing gzip or bzip2 files, fzopen only supports the suffixes .z and .gz for gzipped files and .bz2 for bzip2ed files. All supported formats can be found in the following table:
On reading first the appropriate suffixes are checked if not provided. If no file is found the magic byte sequence at the beginning of the file is checked to detect a gzip or bzip2 file.
The zlib home page at http://www.zlib.net
The bzip2 home page at http://www.bzip.org
The gzip home page at http://www.gzip.org
The LZMA home page at http://tukaani.org/lzma
The XZ home page at http://tukaani.org/xz