gzrewind

Name

gzrewind -- reset the file-position indicator on a compressed file stream

Synopsis

#include <zlib.h>

int gzrewind(gzFile file);

Description

The gzrewind() function shall set the starting position for the next read on compressed file stream file to the beginning of file. file must be open for reading.

gzrewind() is equivalent to

(int)gzseek(file, 0L, SEEK_SET)
.

Return Value

On success, gzrewind() shall return 0. On error, gzrewind() shall return -1, and may set the error value for file accordingly.

Errors

On error, gzrewind() shall return -1, indicating that file is NULL, or does not represent an open compressed file stream, or represents a compressed file stream that is open for writing and is not currently at the beginning of file.