comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » True size of a gzip compressed file?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
True size of a gzip compressed file? [message #33779] Tue, 28 January 2003 12:34
Wayne Landsman is currently offline  Wayne Landsman
Messages: 117
Registered: January 1997
Senior Member
When one opens a gzip compressed file using the /COMPRESS keyword to
OPENR, does anyone know if there is a way to quickly get the size in
bytes of the uncompressed file? If one uses the structure returned
by FSTAT then fstat(unit) gives the size in bytes of the compressed file
(so that the value of the current pointer (fstat.cur_ptr) can be larger
than the value given by fstat.size.)

One way to do this is to use the SKIP_LUN (V5.6) with the /EOF and
TRANSFER_COUNT keywords and records the number of bytes actually read
until the EOF reached. For earlier IDL versions one can try to
read into a large buffer with READU and again use the TRANSFER_COUNT
keyword. In either case, the process is slow because one has to read
through the entire file.

One quick way is to spawn to a "gzip -l" command and parse the
output. However, I worry about getting different output depending on
which shell or OS is being used. But I believe it does show that one
can get this information without reading the entire file.

Thanks, --Wayne Landsman
landsman@mpb.gsfc.nasa.gov
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: simple array math question
Next Topic: Re: True size of a gzip compressed file?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 10:48:26 PDT 2025

Total time taken to generate the page: 0.00414 seconds