Re: seek to the end of file



Joe <divya_krs@xxxxxxxxx> writes:
On Jul 31, 11:35 am, Hans-Peter Diettrich <DrDiettri...@xxxxxxx>
wrote:
Joe wrote:
I would like to find out the size of the gz file using zlib API calls.
For this, I was thinking of calling gzseek () with SEEK_END and then
use gztell(). But unfortunately SEEK_END is not supported. Is there a
way to overcome this?

You'll have to gzread until the end of the stream is reached, summing up
the number of bytes read.

As I understand the zlib, it's a stream format, so that the size of the
stream can not be known before the sender, i.e. inflate(), stops to
provide further data.

DoDi

gzseek returns the resulting offset location in bytes from the
beginning of the uncompressed stream. Even if I get to the end of the
uncompressed stream, I'm fine with that.

Reading until the end of the stream using gzread would be extremely
slow. So I think there should be a better way.

What do you want to do in the case where the single .gz file contains
several concatenated gzipped streams?

Phil
--
Dear aunt, let's set so double the killer delete select all.
-- Microsoft voice recognition live demonstration
.



Relevant Pages

  • Re: seek to the end of file
    ... I was thinking of calling gzseek with SEEK_END and then ... You'll have to gzread until the end of the stream is reached, ... uncompressed stream, I'm fine with that. ...
    (comp.compression)
  • Re: seek to the end of file
    ... Joe wrote: ... I was thinking of calling gzseek with SEEK_END and then ... use gztell(). ... You'll have to gzread until the end of the stream is reached, summing up the number of bytes read. ...
    (comp.compression)
  • Re: RTF to RTF Compressed
    ... uncompressed stream after writing it. ... >> How can I convert it to RTF Compressed? ...
    (microsoft.public.win32.programmer.messaging)
  • Re: TaskItem and AppointmentItem formated body
    ... OpenPropertyto get the compressed stream ... WrapCompressedRTFStream() to get an uncompressed stream out ... then use standard IStream operations on that stream, ...
    (microsoft.public.outlook.program_vba)