From 50633f8f4e8d629e65d96f83abd9f99ca2cad463 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 26 Apr 2016 20:55:49 +0000 Subject: gzip-1.8 --- sample/ztouch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 sample/ztouch (limited to 'sample/ztouch') diff --git a/sample/ztouch b/sample/ztouch new file mode 100755 index 0000000..c5d30ad --- /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"; + } +} -- cgit v1.2.1