1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-25 16:02:13 +01:00
Files
archived-doc-es/reference/filesystem/functions/tmpfile.xml
Pedro Antonio Gil Rodríguez caa121b313 Correcciones de un usuario anónimo
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@336081 c90b9560-bf6c-de11-be94-00142212c4b1
2015-03-17 15:51:19 +00:00

100 lines
2.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 961e402431ff43620e77ccebb4b0f3813f044c70 Maintainer: seros Status: ready -->
<!-- Reviewed: no -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.tmpfile">
<refnamediv>
<refname>tmpfile</refname>
<refpurpose>Crea un archivo temporal</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>tmpfile</methodname>
<void/>
</methodsynopsis>
<para>
Crea un archivo temporal con un nombre único en modo lectura-escritura (w+) y
devuelve un gestor de archivo.
</para>
<para>
El archivo es automáticamente eliminado cuando se cierra (por ejemplo, llamando a
<function>fclose</function>, o cuando no quedan referencias al
gestor de ficheros devuelto por <function>tmpfile</function>), o cuando el
script finaliza.
</para>
<para>
Para más detalles, consulte la documentación de su sistema acerca de la
función <literal>tmpfile(3)</literal>, así como de la cabecera de archivo
<filename>stdio.h</filename>.
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Devuelve un gestor de archivo, similar al devuleto por
<function>fopen</function>, para un archivo nuevo &return.falseforfailure;.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Ejemplo de <function>tmpfile</function></title>
<programlisting role="php">
<![CDATA[
<?php
$temp = tmpfile();
fwrite($temp, "escribiendo en el archivo temporal");
fseek($temp, 0);
echo fread($temp, 1024);
fclose($temp); // esto elimina el archivo
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
writing to tempfile
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>tempnam</function></member>
<member><function>sys_get_temp_dir</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
-->