gzclose

Name

gzclose -- close a compressed file stream

Synopsis

#include <zlib.h>

int gzclose (gzFile file );

Description

The gzclose() function shall close the compressed file stream file. If file was open for writing, gzclose() shall first flush any pending output. Any state information allocated shall be freed.

Return Value

On success, gzclose() shall return Z_OK. Otherwise, gzclose() shall return an error value as described below.

Errors

On error, gzclose() may set the global variable errno to indicate the error. The gzclose() shall return a value other than Z_OK on error.

Z_STREAM_ERROR 

file was NULL (or Z_NULL), or did not refer to an open compressed file stream.

Z_ERRNO 

An error occurred in the underlying base libraries, and the application should check errno for further information.

Z_BUF_ERROR 

no compression progress is possible during buffer flush (see deflate()).