diff options
Diffstat (limited to 'subr/rtl_complex.subr')
-rw-r--r-- | subr/rtl_complex.subr | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/subr/rtl_complex.subr b/subr/rtl_complex.subr index 2c23cfe8..4a055515 100644 --- a/subr/rtl_complex.subr +++ b/subr/rtl_complex.subr @@ -164,11 +164,16 @@ rtl_head() { }; rtl_is_newer() { - local _new_fname="${1}" _old_fname="${2}"; - if [ -n "$(find -name "${_new_fname}" -newer "${_old_fname}" 2>/dev/null)" ]; then + local _new_fname="${1}" _old_fname="${2}" _new_ts="" _old_ts=""; + if ! [ -e "${_old_fname}" ]; then return 0; - else - return 1; + else _new_ts="$(stat -c %Y "${_new_fname}" 2>&1)"; + _old_ts="$(stat -c %Y "${_old_fname}" 2>&1)"; + if [ "${_new_ts:-0}" -gt "${_old_ts:-0}" ]; then + return 0; + else + return 1; + fi; fi; }; |