diff options
author | Thomas Mueller <thomas.mueller@tmit.eu> | 2013-06-10 19:28:55 +0200 |
---|---|---|
committer | Thomas Mueller <thomas.mueller@tmit.eu> | 2013-06-10 19:28:55 +0200 |
commit | 74a170f2a5e934bca7878fc229ad04cb9cf6e543 (patch) | |
tree | 6108138f990510560e9691a2059c337bb62139d3 /lib | |
parent | c0b25a43752427df90c4a2e6564e8325d12ee4f4 (diff) | |
download | nextcloud-server-74a170f2a5e934bca7878fc229ad04cb9cf6e543.tar.gz nextcloud-server-74a170f2a5e934bca7878fc229ad04cb9cf6e543.zip |
[Fixing unit tests in Windows]
on windows open resources will be locked while the stream is open.
closing the resource allows deletion below
Diffstat (limited to 'lib')
-rw-r--r-- | lib/files/view.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/files/view.php b/lib/files/view.php index e2fc8d965b8..25071709fbe 100644 --- a/lib/files/view.php +++ b/lib/files/view.php @@ -386,6 +386,12 @@ class View { $source = $this->fopen($path1 . $postFix1, 'r'); $target = $this->fopen($path2 . $postFix2, 'w'); list($count, $result) = \OC_Helper::streamCopy($source, $target); + + // close open handle - especially $source is necessary because unlink below will + // throw an exception on windows because the file is locked + fclose($source); + fclose($target); + if ($result !== false) { list($storage1, $internalPath1) = Filesystem::resolvePath($absolutePath1 . $postFix1); $storage1->unlink($internalPath1); |