diff options
| author | Cameron Katri <me@cameronkatri.com> | 2021-05-21 09:21:42 -0400 |
|---|---|---|
| committer | Cameron Katri <me@cameronkatri.com> | 2021-05-21 09:21:42 -0400 |
| commit | f06784df5a44c2aeb450ff88346a96f0bc9eb732 (patch) | |
| tree | 49e9923a65f7cf572a6f0833737b72848299b1c8 /file_cmds/tests/touch.sh | |
| parent | 0e3bb24ea8cde1573760b88ad56c1cc00be15cc8 (diff) | |
| parent | 8d788054a62508f8d1b93067be16fb73f987ca8e (diff) | |
| download | apple_cmds-f06784df5a44c2aeb450ff88346a96f0bc9eb732.tar.gz apple_cmds-f06784df5a44c2aeb450ff88346a96f0bc9eb732.zip | |
Merge branch 'apple'
Diffstat (limited to 'file_cmds/tests/touch.sh')
| -rw-r--r-- | file_cmds/tests/touch.sh | 14 |
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 |
