fpassthru: incorporate notes

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@65052 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
jim winstead 2001-12-14 19:38:23 +00:00
parent f47ca63fe5
commit 6881b27f94

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.98 $ -->
<!-- $Revision: 1.99 $ -->
<reference id="ref.filesystem">
<title>Filesystem functions</title>
<titleabbrev>Filesystem</titleabbrev>
@ -1366,25 +1366,35 @@ $fp = fopen ("c:\\data\\info.txt", "r");
</funcprototype>
</funcsynopsis>
<simpara>
Reads to EOF on the given file pointer and writes the results to
standard output.
Reads to EOF on the given file pointer from the current position and
writes the results to standard output.
</simpara>
<simpara>
If an error occurs, <function>fpassthru</function> returns
&false;.
</simpara>
<simpara>
The file pointer must be valid, and must point to a file
successfully opened by <function>fopen</function>,
<function>popen</function>, or <function>fsockopen</function>.
The file is closed when <function>fpassthru</function> is done
reading it (leaving <parameter>fp</parameter> useless).
The file pointer must be valid, and must point to a file successfully
opened by <function>fopen</function>, <function>popen</function>, or
<function>fsockopen</function>. You may need to call
<function>rewind</function> to reset the file pointer to the beginning of
the file if you have already written data to the file. The file is
closed when <function>fpassthru</function> is done reading it (leaving
<parameter>fp</parameter> useless).
</simpara>
<simpara>
If you just want to dump the contents of a file to stdout you may
want to use the <function>readfile</function>, which saves you
the <function>fopen</function> call.
</simpara>
<note>
<para>
When using <function>fpassthru</function> on a binary file on Windows
systems, you should make sure to open the file in binary mode by
appending a <literal>b</literal> to the mode used in the call to
<function>fopen</function>.
</para>
</note>
<simpara>
See also <function>readfile</function>,
<function>fopen</function>, <function>popen</function>, and