Last active
August 25, 2020 14:10
-
-
Save ozanturksever/4968827 to your computer and use it in GitHub Desktop.
python get uncompressed size of a .gz file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_uncompressed_size(self, file): | |
fileobj = open(file, 'r') | |
fileobj.seek(-8, 2) | |
crc32 = gzip.read32(fileobj) | |
isize = gzip.read32(fileobj) # may exceed 2GB | |
fileobj.close() | |
return isize |
nerohmot
commented
Aug 25, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment