diff options
Diffstat (limited to 'lib/helper.php')
-rw-r--r-- | lib/helper.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/helper.php b/lib/helper.php index 60af4e376b1..525a096947d 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -398,4 +398,21 @@ class OC_Helper { } return false; } + + /** + * copy the contents of one stream to another + * @param resource source + * @param resource target + * @return int the number of bytes copied + */ + public static function streamCopy($source,$target){ + if(!$source or !$target){ + return false; + } + $count=0; + while(!feof($source)){ + $count+=fwrite($target,fread($source,8192)); + } + return $count; + } } |