mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-25 17:32:07 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@351753 c90b9560-bf6c-de11-be94-00142212c4b1
177 lines
5.2 KiB
XML
177 lines
5.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: e41806c30bf6975e452c0d4ce35ab0984c2fa68c Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
|
|
<refentry xml:id="function.dio-open" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>dio_open</refname>
|
|
<refpurpose>Ouvre un nouveau fichier avec les permissions spécifiées</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<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><initializer>0</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Ouvre un accès à un fichier et retourne une ressource de fichier.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>filename</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Le chemin vers le fichier à ouvrir.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>flags</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Le paramètre <parameter>flags</parameter> est une valeur
|
|
comprenant des drapeaux depuis la liste suivante. Cette valeur
|
|
<emphasis>doit</emphasis> inclure une constante parmi
|
|
<constant>O_RDONLY</constant>, <constant>O_WRONLY</constant>,
|
|
ou <constant>O_RDWR</constant>. À cette constante, vous pouvez
|
|
y ajouter n'importe quel drapeaux depuis cette liste.
|
|
<itemizedlist>
|
|
<listitem>
|
|
<para>
|
|
<constant>O_RDONLY</constant> : ouvre le fichier en lecture seule.
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
<constant>O_WRONLY</constant> : ouvre le fichier en écriture.
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
<constant>O_RDWR</constant> : ouvre le fichier en lecture et écriture.
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
<constant>O_CREAT</constant> : crée le fichier, s'il n'existe pas.
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
<constant>O_EXCL</constant> : si <constant>O_CREAT</constant>
|
|
et <constant>O_EXCL</constant> sont utilisés et que le fichier existe,
|
|
<function>dio_open</function> échouera.
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
<constant>O_TRUNC</constant> : si le fichier existe et qu'il est ouvert en écriture,
|
|
le fichier sera réduit à la taille nulle.
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
<constant>O_APPEND</constant> : les écritures se font à partir de la fin du fichier.
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
<constant>O_NONBLOCK</constant> : active le mode non-bloquant.
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
<constant>O_NOCTTY</constant> : évite que le système d'exploitation
|
|
n'assigne au fichier ouvert un processus contrôlant le terminal
|
|
lorsque ce fichier est un fichier TTY.
|
|
</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>mode</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Si <parameter>flags</parameter> contient
|
|
<constant>O_CREAT</constant>, <parameter>mode</parameter> définira
|
|
les permissions du fichier (permissions de création).
|
|
<parameter>mode</parameter> est requis pour une opération
|
|
correcte lorsque <constant>O_CREAT</constant> est spécifié
|
|
dans le <parameter>flags</parameter> et est ignoré sinon.
|
|
</para>
|
|
<para>
|
|
Les permissions assignées au fichier créé seront affectées
|
|
par la configuration du processus <emphasis>umask</emphasis>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Une ressource de fichier ou &false; en cas d'erreur.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title>Ouverture d'un fichier</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$fd = dio_open('/dev/ttyS0', O_RDWR | O_NOCTTY | O_NONBLOCK);
|
|
|
|
dio_close($fd);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>dio_close</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
|
|
-->
|