1
0
Files
irix-657m-src/eoe/cmd/gzip/sample/ztouch
2022-09-29 17:59:04 +03:00

16 lines
384 B
Perl
Executable File

#! /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";
}
}