summaryrefslogtreecommitdiff
path: root/Build/source/utils/gzip/sample/ztouch
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/gzip/sample/ztouch')
-rw-r--r--Build/source/utils/gzip/sample/ztouch15
1 files changed, 15 insertions, 0 deletions
diff --git a/Build/source/utils/gzip/sample/ztouch b/Build/source/utils/gzip/sample/ztouch
new file mode 100644
index 00000000000..e408e2bc50b
--- /dev/null
+++ b/Build/source/utils/gzip/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";
+ }
+}