From 3869aa239311b4e8cbefd683f78f5fbb14a01e5c Mon Sep 17 00:00:00 2001 From: Iltar van der Berg Date: Fri, 4 Jan 2013 12:28:25 +0100 Subject: [PATCH 1/2] Fix to prevent touch from failing if it already exists but made by another user when atime is not used --- Filesystem.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Filesystem.php b/Filesystem.php index 86709c3e4b..7a24124f32 100644 --- a/Filesystem.php +++ b/Filesystem.php @@ -100,10 +100,6 @@ public function exists($files) */ public function touch($files, $time = null, $atime = null) { - if (null === $time) { - $time = time(); - } - foreach ($this->toIterator($files) as $file) { if (true !== @touch($file, $time, $atime)) { throw new IOException(sprintf('Failed to touch %s', $file)); From b5aca5537a8dee490e90395658358b3bc63c332d Mon Sep 17 00:00:00 2001 From: Iltar van der Berg Date: Fri, 4 Jan 2013 12:46:39 +0100 Subject: [PATCH 2/2] Small update regarding previous commit --- Filesystem.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Filesystem.php b/Filesystem.php index 7a24124f32..513182b877 100644 --- a/Filesystem.php +++ b/Filesystem.php @@ -101,7 +101,8 @@ public function exists($files) public function touch($files, $time = null, $atime = null) { foreach ($this->toIterator($files) as $file) { - if (true !== @touch($file, $time, $atime)) { + $touch = $time ? @touch($file, $time, $atime) : @touch($file); + if (true !== $touch) { throw new IOException(sprintf('Failed to touch %s', $file)); } }