mirror of
https://github.com/php/doc-ru.git
synced 2025-07-30 12:57:40 +00:00
112 lines
3.2 KiB
XML
112 lines
3.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!-- EN-Revision: 0c9c2dd669fe9395eaa73d487fbd160f9057429a Maintainer: shein Status: ready -->
|
||
<!-- Reviewed: no -->
|
||
<refentry xml:id="function.ftell" xmlns="http://docbook.org/ns/docbook">
|
||
<refnamediv>
|
||
<refname>ftell</refname>
|
||
<refpurpose>Возвращает текущую позицию указателя чтения/записи файла</refpurpose>
|
||
</refnamediv>
|
||
|
||
<refsect1 role="description">
|
||
&reftitle.description;
|
||
<methodsynopsis>
|
||
<type class="union"><type>int</type><type>false</type></type><methodname>ftell</methodname>
|
||
<methodparam><type>resource</type><parameter>stream</parameter></methodparam>
|
||
</methodsynopsis>
|
||
<para>
|
||
Возвращает позицию файлового указателя <parameter>stream</parameter>.
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="parameters">
|
||
&reftitle.parameters;
|
||
<para>
|
||
<variablelist>
|
||
<varlistentry>
|
||
<term><parameter>stream</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
Файловый указатель должен быть действующим указателем
|
||
на поток, открытый функциями <function>fopen</function> или
|
||
<function>popen</function>.
|
||
<function>ftell</function> возвращает неопределённые результаты
|
||
для потоков, разрешающих только запись в конец
|
||
(открытых с флагом "a").
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
</variablelist>
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="returnvalues">
|
||
&reftitle.returnvalues;
|
||
<para>
|
||
Возвращает позицию файлового указателя <parameter>stream</parameter>
|
||
в виде целого числа, то есть его смещение в файловом потоке.
|
||
</para>
|
||
<para>
|
||
При возникновении ошибки возвращает &false;.
|
||
</para>
|
||
&fs.file.32bit;
|
||
</refsect1>
|
||
|
||
<refsect1 role="examples">
|
||
&reftitle.examples;
|
||
<para>
|
||
<example>
|
||
<title>Пример использования функции <function>ftell</function></title>
|
||
<programlisting role="php">
|
||
<![CDATA[
|
||
<?php
|
||
|
||
// открываем файл и читаем немного данных
|
||
$fp = fopen("/etc/passwd", "r");
|
||
$data = fgets($fp, 12);
|
||
|
||
// где же мы ?
|
||
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
|
||
-->
|