Browse Source
round the mtime in touch
Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/4096/head
Robin Appelman
9 years ago
No known key found for this signature in database
GPG Key ID: 50F2B59C6DEBBCFE
2 changed files with
18 additions and
1 deletions
-
lib/private/Files/View.php
-
tests/lib/Files/ViewTest.php
|
|
|
@ -569,7 +569,7 @@ class View { |
|
|
|
$mtime = time(); |
|
|
|
} |
|
|
|
//if native touch fails, we emulate it by changing the mtime in the cache
|
|
|
|
$this->putFileInfo($path, array('mtime' => $mtime)); |
|
|
|
$this->putFileInfo($path, array('mtime' => floor($mtime))); |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
@ -588,6 +588,23 @@ class ViewTest extends \Test\TestCase { |
|
|
|
$this->assertEquals($cachedData['storage_mtime'], $cachedData['mtime']); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @medium |
|
|
|
*/ |
|
|
|
public function testTouchFloat() { |
|
|
|
$storage = $this->getTestStorage(true, TemporaryNoTouch::class); |
|
|
|
|
|
|
|
Filesystem::mount($storage, array(), '/'); |
|
|
|
|
|
|
|
$rootView = new View(''); |
|
|
|
$oldCachedData = $rootView->getFileInfo('foo.txt'); |
|
|
|
|
|
|
|
$rootView->touch('foo.txt', 500.5); |
|
|
|
|
|
|
|
$cachedData = $rootView->getFileInfo('foo.txt'); |
|
|
|
$this->assertEquals(500, $cachedData['mtime']); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @medium |
|
|
|
*/ |
|
|
|
|