note 98119 added to function.stream-copy-to-stream
| From: | felix dot nensa at gmail dot com | Date: | Wed, 26 May 2010 23:57:28 +0000 |
| Subject: | note 98119 added to function.stream-copy-to-stream | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-169639@lists.php.net to get a copy of this message | ||
As stream_copy_to_stream() seems to be quite a memory hog (at least in PHP 5.1.6 64-bit) it may be
way more efficient just to copy streams with this simple PHP alternative:
<?php
function pipe_streams($in, $out)
{
$size = 0;
while (!feof($in)) $size += fwrite($out,fread($in,8192));
return $size;
}
?>
----
Server IP: 217.160.235.204
Probable Submitter: 87.79.193.34
----
Manual Page -- http://www.php.net/manual/en/function.stream-copy-to-stream.php
Edit -- https://master.php.net/note/edit/98119
Del: integrated -- https://master.php.net/note/delete/98119/integrated
Del: useless -- https://master.php.net/note/delete/98119/useless
Del: bad code -- https://master.php.net/note/delete/98119/bad+code
Del: spam -- https://master.php.net/note/delete/98119/spam
Del: non-english -- https://master.php.net/note/delete/98119/non-english
Del: in docs -- https://master.php.net/note/delete/98119/in+docs
Del: other reasons-- https://master.php.net/note/delete/98119
Reject -- https://master.php.net/note/reject/98119
Search -- https://master.php.net/manage/user-notes.php