mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-04-25 09:38:03 +02:00
133 lines
3.4 KiB
XML
133 lines
3.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 265acc36ee4a1f4553a52030bf1717521c24dfb4 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
|
|
<refentry xml:id="function.posix-access" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>posix_access</refname>
|
|
<refpurpose>
|
|
Détermine l'accessibilité d'un fichier
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>posix_access</methodname>
|
|
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam>
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
<function>posix_access</function> vérifie les permissions utilisateurs
|
|
pour un fichier.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>filename</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Le nom du fichier à tester.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>flags</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Un masque constitué d'une ou plusieurs constantes parmi
|
|
<constant>POSIX_F_OK</constant>, <constant>POSIX_R_OK</constant>,
|
|
<constant>POSIX_W_OK</constant> et
|
|
<constant>POSIX_X_OK</constant>.
|
|
</para>
|
|
<para>
|
|
<constant>POSIX_R_OK</constant>, <constant>POSIX_W_OK</constant> et
|
|
<constant>POSIX_X_OK</constant> vérifie si, respectivement, le fichier
|
|
existe et a les permissions en lecture, écriture et exécution.
|
|
<constant>POSIX_F_OK</constant> vérifie uniquement si le fichier existe.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>posix_access</function></title>
|
|
<para>
|
|
Cet exemple vérifie si le fichier $file a les permissions en lecture et en écriture,
|
|
sinon, il affiche un message d'erreur.
|
|
</para>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$file = 'un_fichier';
|
|
|
|
if (posix_access($file, POSIX_R_OK | POSIX_W_OK)) {
|
|
echo 'Le fichier a les permissions en lecture et en écriture !';
|
|
|
|
} else {
|
|
$error = posix_get_last_error();
|
|
|
|
echo "Erreur $error: " . posix_strerror($error);
|
|
}
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>posix_get_last_error</function></member>
|
|
<member><function>posix_strerror</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
|
|
-->
|