aboutsummaryrefslogtreecommitdiffstats
path: root/file_cmds/tests/touch.sh
diff options
context:
space:
mode:
authorCameron Katri <me@cameronkatri.com>2021-05-20 16:22:02 -0400
committerCameron Katri <me@cameronkatri.com>2021-05-20 16:22:02 -0400
commitf5569153b7df6d141164c27040ef0076732f2da7 (patch)
tree338e90c0f5de223bf790b85410838c0bc21cc61d /file_cmds/tests/touch.sh
parent591e92d95c376763dde539fadf0498bd1358073d (diff)
downloadapple_cmds-f5569153b7df6d141164c27040ef0076732f2da7.tar.gz
apple_cmds-f5569153b7df6d141164c27040ef0076732f2da7.zip
file_cmds: 321.100.10.0.1
Diffstat (limited to 'file_cmds/tests/touch.sh')
-rw-r--r--file_cmds/tests/touch.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/file_cmds/tests/touch.sh b/file_cmds/tests/touch.sh
new file mode 100644
index 0000000..d38684d
--- /dev/null
+++ b/file_cmds/tests/touch.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+file_name=`mktemp /tmp/XXXXXX`
+file_ctime=`/usr/bin/stat -f%c ${file_name}`
+
+/usr/bin/touch $file_name
+file_mtime=`/usr/bin/stat -f%m ${file_name}`
+
+if [ "$file_ctime" -gt "$file_mtime" ]; then
+ echo "file's mod time ($file_mtime) should be later than the file's creation time ($file_ctime)"
+ exit 1
+fi
+
+exit 0