From f5569153b7df6d141164c27040ef0076732f2da7 Mon Sep 17 00:00:00 2001 From: Cameron Katri Date: Thu, 20 May 2021 16:22:02 -0400 Subject: file_cmds: 321.100.10.0.1 --- file_cmds/tests/touch.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 file_cmds/tests/touch.sh (limited to 'file_cmds/tests/touch.sh') 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 -- cgit v1.2.3