gzip/sample/ztouch
Jim Meyering e914d164fb maint: change "time stamp" to "timestamp" globally
This avoids a new syntax-check failure.
* ChangeLog-2007: Perform that change.
* NEWS: Likewise.
* algorithm.doc: Likewise.
* doc/gzip.texi: Likewise.
* gunzip.in: Likewise.
* gzip.1: Likewise.
* gzip.c: Likewise.
* gzip.h: Likewise.
* m4/.gitignore: Likewise.
* sample/ztouch: Likewise.
* tests/timestamp: Likewise.
* unzip.c: Likewise.
* zip.c: Likewise.
* znew.1: Likewise.
* cfg.mk: Update the old news hash accordingly.
2017-02-06 10:13:52 -08:00

16 lines
397 B
Perl
Executable File

#! /usr/local/bin/perl
# Set the timestamp of a gzip'ed file from that stored in the file.
# usage: ztouch files...
foreach $file (@ARGV) {
open (FILE, $file);
read (FILE, $_, 8);
($magic, $method, $flags, $time) = unpack ("A2C2V", $_);
if ($magic eq "\037\213") {
utime ($time, $time, $file);
}
else {
warn "$file is not compressed with gzip!\n";
}
}