diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-02-22 16:43:11 +0100 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-02-22 16:43:11 +0100 |
commit | d8137fdf66a513d0de4bb234d0427ff27ca40106 (patch) | |
tree | d02f9782f8e7e77670f03469847b3044e1172f53 /lib/files/view.php | |
parent | 5b949596867c986916568e5bea2003e04102aa71 (diff) | |
download | nextcloud-server-d8137fdf66a513d0de4bb234d0427ff27ca40106.tar.gz nextcloud-server-d8137fdf66a513d0de4bb234d0427ff27ca40106.zip |
return both, count and result if the operation succeeded or failed. Maybe in some cases it is useful to know how much bytes where copied
Diffstat (limited to 'lib/files/view.php')
-rw-r--r-- | lib/files/view.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/files/view.php b/lib/files/view.php index 11edbadab9b..f48d0c8b225 100644 --- a/lib/files/view.php +++ b/lib/files/view.php @@ -285,7 +285,7 @@ class View { } $target = $this->fopen($path, 'w'); if ($target) { - $count = \OC_Helper::streamCopy($data, $target); + list ($count, $result) = \OC_Helper::streamCopy($data, $target); fclose($target); fclose($data); if ($this->fakeRoot == Filesystem::getRoot()) { @@ -303,7 +303,7 @@ class View { ); } \OC_FileProxy::runPostProxies('file_put_contents', $absolutePath, $count); - return $count > 0; + return $result; } else { return false; } @@ -361,7 +361,7 @@ class View { } else { $source = $this->fopen($path1 . $postFix1, 'r'); $target = $this->fopen($path2 . $postFix2, 'w'); - $result = \OC_Helper::streamCopy($source, $target); + list($count, $result) = \OC_Helper::streamCopy($source, $target); list($storage1, $internalPath1) = Filesystem::resolvePath($absolutePath1 . $postFix1); $storage1->unlink($internalPath1); } @@ -443,7 +443,7 @@ class View { } else { $source = $this->fopen($path1 . $postFix1, 'r'); $target = $this->fopen($path2 . $postFix2, 'w'); - $result = \OC_Helper::streamCopy($source, $target); + list($count, $result) = \OC_Helper::streamCopy($source, $target); } if ($this->fakeRoot == Filesystem::getRoot()) { \OC_Hook::emit( |