php-doc-en/chapters/streams.file.xml
Wez Furlong 8632d87a0b Add docs for streams.
Note: some wizard might need to juggle things so that it belongs in a part
of it's own or something: I'm no doc guru.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@91492 c90b9560-bf6c-de11-be94-00142212c4b1
2002-08-10 23:38:41 +00:00

104 lines
3.8 KiB
XML
Executable file

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- Author: Wez Furlong <wez@thebrainroom.com>
Please contact me before making any major amendments to the
content of this section. Splitting/Merging are fine if they are
required for php-doc restructuring purposes - just drop me a line
if you make a change (so I can update my local copy).
-->
<sect1 id="streams.file-api">
<title>Streams File API Reference</title>
<refentry id="streams.php-stream-fopen-from-file">
<refnamediv>
<refname>php_stream_fopen_from_file</refname>
<refpurpose>Convert an ANSI FILE* into a stream</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>php_stream *</type><methodname>php_stream_fopen_from_file</methodname>
<methodparam><type>FILE *</type><parameter>file</parameter></methodparam>
<methodparam><type>char *</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>
<function>php_stream_fopen_from_file</function> returns a stream based on the
<parameter>file</parameter>. <parameter>mode</parameter> must be the same
as the mode used to open <parameter>file</parameter>, otherwise strange errors
may occur when trying to write when the mode of the stream is different from the mode
on the file.
</para>
</refsect1>
</refentry>
<refentry id="streams.php-stream-fopen-tmpfile">
<refnamediv>
<refname>php_stream_fopen_tmpfile</refname>
<refpurpose>Open a FILE* with tmpfile() and convert into a stream</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>php_stream *</type><methodname>php_stream_fopen_tmpfile</methodname>
<methodparam><type>void</type><parameter></parameter></methodparam>
</methodsynopsis>
<para>
<function>php_stream_fopen_from_file</function> returns a stream based on a
temporary file opened with a mode of "w+b". The temporary file will be deleted
automatically when the stream is closed or the process terminates.
</para>
</refsect1>
</refentry>
<refentry id="streams.php-stream-fopen-temporary-file">
<refnamediv>
<refname>php_stream_fopen_temporary_file</refname>
<refpurpose>Generate a temporary file name and open a stream on it</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>php_stream *</type><methodname>php_stream_fopen_temporary_file</methodname>
<methodparam><type>const char *</type><parameter>dir</parameter></methodparam>
<methodparam><type>const char *</type><parameter>pfx</parameter></methodparam>
<methodparam><type>char **</type><parameter>opened</parameter></methodparam>
</methodsynopsis>
<para>
<function>php_stream_fopen_temporary_file</function> generates a temporary file name
in the directory specified by <parameter>dir</parameter> and with a prefix of <parameter>pfx</parameter>.
The generated file name is returns in the <parameter>opened</parameter> parameter, which you
are responsible for cleaning up using <function>efree</function>.
A stream is opened on that generated filename in "w+b" mode.
The file is NOT automatically deleted; you are responsible for unlinking or moving the file when you have
finished with it.
</para>
</refsect1>
</refentry>
</sect1>
<!-- 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
-->