Re: difference between copy and strem_copy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Negin Nickparsa wrote:

> what is the difference in copying data from the file rather than a stream?
> 
> stream_copy_to_stream — Copies data from one stream to another
> copy — Copies file

The most relevant difference is that copy() works with file *names*
(note, that this is not necessarily restricted to actual files, but
rather allows arbitrary streams[1]), and stream_copy_to_stream() works
with *resources* (i.e. already opened streams).

Another difference is that stream_copy_to_stream() is able to copy only
parts of a stream, whereas copy() always copies the complete file.

[1] <http://php.net/manual/en/intro.stream.php>

-- 
Christoph M. Becker



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux