summaryrefslogtreecommitdiff
path: root/now.pl
diff options
context:
space:
mode:
authorhpa <hpa>1998-04-15 03:07:22 +0000
committerhpa <hpa>1998-04-15 03:07:22 +0000
commit3875d86266cbeb5cc1764b5d31b0ce6908612b30 (patch)
treef579bacc8dbc8a6acd88ffda2766aba135fdbae8 /now.pl
parent76fd2d8d445379561bc4c19f420d5d4abaa34bca (diff)
downloadsyslinux-3875d86266cbeb5cc1764b5d31b0ce6908612b30.tar.gz
Fix old kernel, OS/2, and mem= bugs. Ready for 1.36 release.syslinux-1.36
Diffstat (limited to 'now.pl')
-rw-r--r--now.pl13
1 files changed, 11 insertions, 2 deletions
diff --git a/now.pl b/now.pl
index 824dcc8f..0626779f 100644
--- a/now.pl
+++ b/now.pl
@@ -1,7 +1,16 @@
#!/usr/bin/perl
#ident "$Id$"
#
-# Print the time as a hexadecimal integer
+# Print the time (possibly the mtime of a file) as a hexadecimal integer
#
-printf "0x%08x\n", time;
+($file) = @ARGV;
+if ( defined($file) ) {
+ ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,
+ $ctime,$blksize,$blocks) = stat($file);
+ $now = $mtime;
+} else {
+ $now = time;
+}
+
+printf "0x%08x\n", $now;