Re: True size of a gzip compressed file? [message #33778] |
Tue, 28 January 2003 14:03 |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
"Wayne Landsman" <landsman@mpb.gsfc.nasa.gov> wrote in message
news:3E36E953.99BA18EE@mpb.gsfc.nasa.gov...
> 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?...
> ...
> 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.
From a quick look at how "gzip -l" is implemented (see lines 1361-1380
or so of gzip.c in...
ftp://wuarchive.wustl.edu/mirrors/gnu/gzip/gzip-1.2.4.tar.gz
...) and a quick look at the contents of a gzippped file, I surmise
that the uncompressed file size is stored at the end of the file (but
only, perhaps, if the DEFLATE compression method has been used).
--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
|
|
|