diff options
Diffstat (limited to 'lib/private/LargeFileHelper.php')
-rw-r--r-- | lib/private/LargeFileHelper.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/private/LargeFileHelper.php b/lib/private/LargeFileHelper.php index 9d0fe864033..b75cdcc210e 100644 --- a/lib/private/LargeFileHelper.php +++ b/lib/private/LargeFileHelper.php @@ -187,6 +187,20 @@ class LargeFileHelper { return $result; } + /** + * Returns the current mtime for $fullPath + * + * @param string $fullPath + * @return int + */ + public function getFileMtime($fullPath) { + if (\OC_Helper::is_function_enabled('exec')) { + return $this->exec('stat -c %Y ' . escapeshellarg($fullPath)); + } + + return filemtime($fullPath); + } + protected function exec($cmd) { $result = trim(exec($cmd)); return ctype_digit($result) ? 0 + $result : null; |