php-doc-en/reference/filesystem/functions/ftell.xml
Jakub Vrana 4641f42abc Can't use ftell with a (bug )
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@165617 c90b9560-bf6c-de11-be94-00142212c4b1
2004-08-07 08:56:21 +00:00

77 lines
2 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 -->
<refentry id="function.ftell">
<refnamediv>
<refname>ftell</refname>
<refpurpose>Tells file pointer read/write position</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>ftell</methodname>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
</methodsynopsis>
<para>
Returns the position of the file pointer referenced by
<parameter>handle</parameter>; i.e., its offset into the
file stream.
</para>
<para>
If an error occurs, returns &false;.
</para>
<para>
The file pointer must be valid, and must point to a file
successfully opened by <function>fopen</function> or
<function>popen</function>.
<function>ftell</function> gives undefined results for append-only streams
(opened with "a" flag).
</para>
<para>
<example>
<title><function>ftell</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
// opens a file and read some data
$fp = fopen("/etc/passwd", "r");
$data = fgets($fp, 12);
// where are we ?
echo ftell($fp); // 11
fclose($fp);
?>
]]>
</programlisting>
</example>
</para>
<para>
See also <function>fopen</function>, <function>popen</function>,
<function>fseek</function>, and <function>rewind</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
-->