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


#include <zlib.h>

int gzrewind(gzFile file);


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.


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.