• Post Reply Bookmark Topic Watch Topic
  • New Topic

How can you check whether a gzip file has been compressed twice?  RSS feed

 
Geane Norm
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I came across a rather peculiar case whereby a proprietary format I am working with has been compressed to a .gz, then renamed it to the proprietary extension and then "re-gz" again (by someone who did not know it was already compressed). Is there a way to check whether a gz file has been compressed twice? In my case, the file is not seen as corrupted and it goes through a process which  it should have not entered it at all.

Thank you,

Regards,

G.
 
Dave Tolls
Ranch Foreman
Posts: 3061
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the header on the file.
Quick wiki check and it's a 10 byte header, but the magic number is the important bit (1f 8b).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!