diff options
author | Jean-loup Gailly <jloup@chorus.fr> | 1993-05-27 14:28:42 +0000 |
---|---|---|
committer | Jean-loup Gailly <jloup@chorus.fr> | 1993-05-27 14:28:42 +0000 |
commit | bc3707e75bc710532fc68e9679362bd40d95771f (patch) | |
tree | 6b89540dbd4d9a4077e560f4dd4a7258b80fbc3b /sample | |
parent | cd3e3d7abbd76c2b8aba74715681988fcc42913a (diff) | |
download | gzip-bc3707e75bc710532fc68e9679362bd40d95771f.tar.gz |
gzip 1.3.5
Diffstat (limited to 'sample')
-rwxr-xr-x | sample/ztouch | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sample/ztouch b/sample/ztouch new file mode 100755 index 0000000..e408e2b --- /dev/null +++ b/sample/ztouch @@ -0,0 +1,15 @@ +#! /usr/local/bin/perl +# Set the time stamp 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"; + } +} |