php-doc-en/reference/dio/functions/dio-open.xml

92 lines
2.8 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/dio.xml, last change in rev 1.1 -->
<refentry id="function.dio-open">
<refnamediv>
<refname>dio_open</refname>
<refpurpose>
Opens a new filename with specified permissions of flags and
creation permissions of mode
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>resource</type><methodname>dio_open</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
<methodparam><type>int</type><parameter>flags</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>
<function>dio_open</function> opens a file and returns a new file
descriptor for it, or &false; if any error occurred. If
<parameter>flags</parameter> is O_CREAT, optional third parameter
<parameter>mode</parameter> will set the mode of the file
(creation permissions). The <parameter>flags</parameter>
parameter can be one of the following options:
<itemizedlist>
<listitem>
<para>O_RDONLY - opens the file for read access</para>
</listitem>
<listitem>
<para>O_WRONLY - opens the file for write access</para>
</listitem>
<listitem>
<para>
O_RDWR - opens the file for both reading and
writing
</para>
</listitem>
</itemizedlist>
The <parameter>flags</parameter> parameter can also include any
combination of the following flags:
<itemizedlist>
<listitem>
<para>
O_CREAT - creates the file, if it doesn't already exist
</para>
</listitem>
<listitem>
<para>
O_EXCL - if both, O_CREAT and O_EXCL are set,
<function>dio_open</function> fails, if file already exists
</para>
</listitem>
<listitem>
<para>
O_TRUNC - if file exists, and its opened for write access,
file will be truncated to zero length.
</para>
</listitem>
<listitem>
<para>
O_APPEND - write operations write data at the
end of file</para></listitem> <listitem><para>O_NONBLOCK -
sets non blocking mode
</para>
</listitem>
</itemizedlist>
</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:"../../../../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
-->