Subject: Re: bug#15315: How to remove date in a gz file?

From: Tomas Härdin <[email-masked]>
Date: Tue, 10 Sep 2013 10:04:50 +0200

On Mon, 2013-09-09 at 17:18 -0500, Peng Yu wrote:
> Hi,
> 
> ~/linux/test/gnu/gzip/gzip$ file test1.txt.gz
> test1.txt.gz: gzip compressed data, was "test1.txt", from Unix, last
> modified: Tue Apr 30 08:16:41 2013
> 
> .gz files have the date information if it is not created with the
> option '-n'. I'm wondering what is the most efficient way to remove
> the date information. (One easy way is gunzip the file and then gzip
> it with '-n', but when the file is large, it might take a long time.)
> I'd imagine there should be a way to directly change the .gz file to
> remove the date info. But I have not found a way to do. Does anybody
> know a way? Thanks.

Judging by [1] and vbindiff:ing two files with and without -n, zeroing
bytes 4..7 should be enough (assuming the file only has one member).

/Tomas

[1] http://www.gzip.org/zlib/rfc-gzip.html