mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-20 19:08:54 +00:00

numbers. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@328615 c90b9560-bf6c-de11-be94-00142212c4b1
109 lines
2.6 KiB
XML
109 lines
2.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.ftell">
|
|
<refnamediv>
|
|
<refname>ftell</refname>
|
|
<refpurpose>Returns the current position of the file read/write pointer</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<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>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>handle</parameter></term>
|
|
<listitem>
|
|
<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>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Returns the position of the file pointer referenced by
|
|
<parameter>handle</parameter> as an integer; i.e., its offset into the file stream.
|
|
</para>
|
|
<para>
|
|
If an error occurs, returns &false;.
|
|
</para>
|
|
&fs.file.32bit;
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<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>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>fopen</function></member>
|
|
<member><function>popen</function></member>
|
|
<member><function>fseek</function></member>
|
|
<member><function>rewind</function></member>
|
|
</simplelist>
|
|
</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:"~/.phpdoc/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
|
|
-->
|