summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2008-02-22 20:27:23 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2008-02-22 20:27:23 (GMT)
commit7f042be4a8ea0f0a095f97508a5e11b5e7ecf16b (patch)
tree8f4c1216832e818f506cb470919eb6a34f1c124f /bin
parent5c5ba12570e6c45acade0b9b103b3f8605488184 (diff)
downloadhdf5-7f042be4a8ea0f0a095f97508a5e11b5e7ecf16b.zip
hdf5-7f042be4a8ea0f0a095f97508a5e11b5e7ecf16b.tar.gz
hdf5-7f042be4a8ea0f0a095f97508a5e11b5e7ecf16b.tar.bz2
[svn-r14637] Added newer for file timestamp comparison. It is used by the non-repeat
test. Updated MANIFEST for this new file.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/newer45
1 files changed, 45 insertions, 0 deletions
diff --git a/bin/newer b/bin/newer
new file mode 100755
index 0000000..8ed9f87
--- /dev/null
+++ b/bin/newer
@@ -0,0 +1,45 @@
+#!/bin/sh
+#
+# Copyright by The HDF Group.
+# Copyright by the Board of Trustees of the University of Illinois.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the files COPYING and Copyright.html. COPYING can be found at the root
+# of the source code distribution tree; Copyright.html can be found at the
+# root level of an installed copy of the electronic HDF5 document set and
+# is linked from the top-level documents page. It can also be found at
+# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
+# access to either file, you may request a copy from help@hdfgroup.org.
+#
+# Compare the modification time of file argument 1 against other file arguments.
+# Return true (0) if argument 1 is newer than all others, otherwise return
+# false (1). If any of the argument is not a file, return false (1).
+#
+# Programmer: Albert Cheng
+# Created Date: 2005/07/06
+# Modification:
+# Albert Cheng 2005/8/30
+# Changed from two arguments to mulitple arguments.
+
+if test $# -lt 2; then
+ exit 1
+fi
+if test ! -f $1; then
+ exit 1
+fi
+f1=$1
+shift
+
+for f in $*; do
+ if test ! -f $f; then
+ exit 1
+ fi
+ if test X = X`find $f1 -newer $f -print`; then
+ exit 1
+ fi
+done
+
+# passed all tests. Must be a file newer than all others.
+exit 0