2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2007-06-20 22:25:43 +00:00
|
|
|
<!-- $Revision: 1.16 $ -->
|
|
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.feof">
|
2007-02-03 08:13:44 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>feof</refname>
|
|
|
|
<refpurpose>Tests for end-of-file on a file pointer</refpurpose>
|
|
|
|
</refnamediv>
|
2007-06-16 01:17:14 +00:00
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2007-02-03 08:13:44 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>bool</type><methodname>feof</methodname>
|
|
|
|
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
2007-06-16 01:17:14 +00:00
|
|
|
<para>
|
|
|
|
Tests for end-of-file on a file pointer.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>handle</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
&fs.validfp.all;
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
2007-02-03 08:13:44 +00:00
|
|
|
<para>
|
|
|
|
Returns &true; if the file pointer is at EOF or an error occurs
|
|
|
|
(including socket timeout); otherwise returns &false;.
|
|
|
|
</para>
|
2007-06-16 01:17:14 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="notes">
|
|
|
|
&reftitle.notes;
|
2007-06-15 19:45:56 +00:00
|
|
|
<warning>
|
|
|
|
<simpara>
|
|
|
|
If a connection opened by <function>fsockopen</function> wasn't closed
|
|
|
|
by the server, <function>feof</function> will wait until a timeout has
|
|
|
|
been reached to return &true;. The default timeout value is 60 seconds.
|
|
|
|
You may use <function>stream_set_timeout</function> to change this
|
|
|
|
value.
|
|
|
|
</simpara>
|
|
|
|
</warning>
|
|
|
|
<warning>
|
|
|
|
<para>
|
|
|
|
If passed file pointer is not valid you may get an infinite loop, because
|
|
|
|
EOF fails to return TRUE.
|
|
|
|
<example>
|
|
|
|
<title><function>feof</function> example with an invalid file pointer</title>
|
|
|
|
<programlisting role="php">
|
2005-09-20 12:06:16 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
// if file can not be read or doesn't exist fopen function returns FALSE
|
|
|
|
$file = @fopen("no_such_file", "r");
|
|
|
|
|
|
|
|
// FALSE from fopen will issue warning and result in infinite loop here
|
|
|
|
while (!feof($file)) {
|
|
|
|
}
|
|
|
|
|
|
|
|
fclose($file);
|
|
|
|
?>
|
2006-02-13 09:06:31 +00:00
|
|
|
]]>
|
2007-06-15 19:45:56 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
</warning>
|
2007-02-03 08:13:44 +00:00
|
|
|
</refsect1>
|
2007-06-16 01:17:14 +00:00
|
|
|
|
2007-02-03 08:13:44 +00:00
|
|
|
</refentry>
|
2002-04-15 00:12:54 +00:00
|
|
|
|
|
|
|
<!-- 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
|
|
|
|
-->
|