gzseek — Sets the file-position indicator for the compressed file stream file.
Libz.lib
#include <zlib.h>
z_off_t gzseek(gzFile file, z_off_t offset, int whence);
On success, gzseek()
shall return the
resulting
offset in the file expressed
as a byte position in the uncompressed data
stream.
On error, gzseek() shall return -1, and
may set the error value for file
accordingly.
The gzseek() function shall set the file-position indicator for the compressed file stream file. The file-position indicator controls where the next read or write operation on the compressed file stream shall take place. The offset indicates a byte offset in the uncompressed data. The whence parameter may be one of:
SEEK_SET |
the offset is relative to the start of the uncompressed data. |
|
SEEK_CUR |
the offset is relative to the current positition in the uncompressed data. |
Note: The value
SEEK_END
need not be supported.
If the file is open for writing, the new offset must be greater than or equal to the current offset. In this case, gzseek() shall compress a sequence of null bytes to fill the gap from the previous offset to the new offset.
To set the file-position indicator for the compressed file stream file:
#include <stdio.h> |
On error, gzseek() shall return -1. The following conditions shall always result in an error:
file
is NULL
file does not represent an open compressed file stream.
The newly computed offset is less than zero.
whence is not one of the supported values.
If file is open for reading, the implementation may still need to uncompress all of the data up to the new offset. As a result, gzseek() may be extremely slow in some circumstances.
For additional information or queries on this page send feedback
© 2005-2007 Nokia |