diff --git a/Yuba.php b/Yuba.php index 1b23c97..e81a743 100755 --- a/Yuba.php +++ b/Yuba.php @@ -435,17 +435,24 @@ foreach ($files as $splFileInfo) { } - // capture stat before values change + // Collect file stat() - if ($splFileInfo->getType() != "link") { - $stx[$i] = array( $splFileInfo->getATime(), - $splFileInfo->getMTime(), - $splFileInfo->getCTime() ); - } + if ($p['stat_mode']) { - $sty[$i] = statToArray(shell_exec("stat -s ".$shellpath." 2>&1")); - - //$sty[$i] = "bypass"; + $sty[$i] = statToArray(shell_exec("stat -s ".$shellpath." 2>&1")); + + if ($p['stat_mode'] > 1 && $splFileInfo->getType() != "link") { + + // capture stat values for postflight comparison + $stx[$i] = array($splFileInfo->getATime(), $splFileInfo->getMTime(), $splFileInfo->getCTime()); + + } + + } else { + + $sty[$i] = "bypass"; + + } // Check file can be read @@ -1168,13 +1175,13 @@ foreach ($files as $splFileInfo) { // Double check stat for file against pre-run value - if ($p['verify_stat'] && $type != "link") { + if ($p['stat_mode'] > 1 && $type != "link") { $restat = statToArray(shell_exec("stat -s ".$shellpath." 2>&1")); $message = array(); if ($sty[$j]['st_atime'] != $restat['st_atime']) { - if ($p['fixatimes'] && $type != "link" && is_writable($pathname)) { + if ($p['stat_mode'] == 3 && is_writable($pathname)) { exec("touch -at `date -r ".$sty[$j]['st_atime']." +%Y%m%d%H%M.%S` ".$shellpath." 2>&1"); $message[] = "atime (fix)"; } else {