gzip and file size

Martin von Loewis loewis at informatik.hu-berlin.de
Tue Nov 6 04:29:27 EST 2001


taw_usenet at yahoo.com (ToddW) writes:

> It's simple to get the correct file size for a file. But if it is
> gzipped, is there a simple way to snag the file size of the
> uncompressed file?

The last four bytes of the file contain the uncompressed size, unless
the file is corrupted. If the compressed file was created by
contatenating multiple compressed files, you can obtain the true
uncompressed size only by uncompressing the entire file.

Regards,
Martin




More information about the Python-list mailing list