New function stream_copy_to_stream()

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@122580 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Sara Golemon 2003-04-04 21:20:26 +00:00
parent 15405dcc5d
commit 47520a718d

View file

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.stream-copy-to-stream">
<refnamediv>
<refname>stream_copy_to_stream</refname>
<refpurpose>Copies data from one stream to another</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>stream_copy_to_stream</methodname>
<methodparam><type>resource</type><parameter>source</parameter></methodparam>
<methodparam><type>resource</type><parameter>dest</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>maxlength</parameter></methodparam>
</methodsynopsis>
<para>
Makes a copy of up to <parameter>maxlength</parameter> bytes
of data from the current position in <parameter>source</parameter> to
<parameter>dest</parameter>. If <parameter>maxlength</parameter>
is not specified, all remaining content in <parameter>source</parameter>
will be copied. Returns the total count of bytes copied.
<example>
<title><function>stream_copy_to_stream</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$src = fopen('http://www.example.com','r');
$dest1 = fopen('first1k.txt','w');
$dest2 = fopen('remainder.txt','w');
print stream_copy_to_stream($src, $dest1, 1024) . " bytes copied to first1k.txt\n";
print stream_copy_to_stream($src, $dest2) . " bytes copied to remainder.txt\n";
?>
]]>
</programlisting>
</example>
</para>
<para>
See also <function>copy</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->