Home »
Public Forums »
archive »
True size of a gzip compressed file?
True size of a gzip compressed file? [message #33779] |
Tue, 28 January 2003 12:34 |
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
|
|
|
Current Time: Wed Oct 08 13:04:47 PDT 2025
Total time taken to generate the page: 0.00393 seconds