mirror of
https://github.com/php/doc-es.git
synced 2026-03-24 15:32:36 +01:00
125 lines
3.6 KiB
XML
125 lines
3.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 906db3b3f78cfa98a7453e3910bcba95bc66d1ee Maintainer: PhilDaiguille Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<refentry xml:id="streamwrapper.stream-read" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>streamWrapper::stream_read</refname>
|
|
<refpurpose>Lee desde el flujo</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type class="union"><type>string</type><type>false</type></type><methodname>streamWrapper::stream_read</methodname>
|
|
<methodparam><type>int</type><parameter>count</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Este método es llamado en respuesta a <function>fread</function>
|
|
y <function>fgets</function>.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
No olvide modificar la posición de lectura y escritura
|
|
del número de bytes que han podido ser leídos.
|
|
</para>
|
|
</note>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>count</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
El número de bytes que han podido ser leídos, a partir de
|
|
la posición actual.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Si hay menos que <parameter>count</parameter> bytes
|
|
disponibles, tantos como sea posible deberían ser retornados.
|
|
Si no hay más datos disponibles, un string vacío debe ser retornado.
|
|
Para señalar un error de lectura &false; debe ser retornado.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors"><!-- {{{ -->
|
|
&reftitle.errors;
|
|
&userstream.not.implemented.warning;
|
|
<note>
|
|
<para>
|
|
Si el valor de retorno es mayor que <parameter>count</parameter>,
|
|
se emitirá una advertencia <constant>E_WARNING</constant>, y
|
|
los datos excedentes se perderán.
|
|
</para>
|
|
</note>
|
|
</refsect1><!-- }}} -->
|
|
|
|
<refsect1 role="notes"><!-- {{{ -->
|
|
&reftitle.notes;
|
|
<note>
|
|
<para>
|
|
<methodname>streamWrapper::stream_eof</methodname> es llamado directamente
|
|
después de <methodname>streamWrapper::stream_read</methodname> para verificar
|
|
si se ha alcanzado <acronym>EOF</acronym>. Si la función no está
|
|
implementada, se utilizará <acronym>EOF</acronym>.
|
|
</para>
|
|
</note>
|
|
<warning>
|
|
<para>
|
|
Al leer completamente un fichero (por ejemplo, mediante
|
|
la función <function>file_get_contents</function>), PHP
|
|
llamará a la función <methodname>streamWrapper::stream_read</methodname>
|
|
seguida de la función <methodname>streamWrapper::stream_eof</methodname>
|
|
en un bucle, pero mientras la función
|
|
<methodname>streamWrapper::stream_read</methodname> retorne un
|
|
string no vacío, el valor retornado de la función
|
|
<methodname>streamWrapper::stream_eof</methodname> será ignorado.
|
|
</para>
|
|
</warning>
|
|
</refsect1><!-- }}} -->
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>fread</function></member>
|
|
<member><function>fgets</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
|
|
-->
|