<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.posix.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.posix-access.php',
    1 => 'posix_access',
    2 => 'Determine accessibility of a file',
  ),
  'up' => 
  array (
    0 => 'ref.posix.php',
    1 => 'POSIX Funzioni',
  ),
  'prev' => 
  array (
    0 => 'ref.posix.php',
    1 => 'POSIX Funzioni',
  ),
  'next' => 
  array (
    0 => 'function.posix-ctermid.php',
    1 => 'posix_ctermid',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/posix/functions/posix-access.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.posix-access" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">posix_access</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">posix_access</span> &mdash; <span class="dc-title">
   Determine accessibility of a file
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.posix-access-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>posix_access</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$filename</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$flags</code><span class="initializer"> = 0</span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>posix_access()</strong></span> checks the user&#039;s permission of a file.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.posix-access-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">filename</code></dt>
      <dd>
       <p class="para">
        The name of the file to be tested.
       </p>
      </dd>
     
    
     <dt><code class="parameter">flags</code></dt>
      <dd>
       <p class="para">
        A mask consisting of one or more of <strong><code><a href="posix.constants.access.php#constant.posix-f-ok">POSIX_F_OK</a></code></strong>,
        <strong><code><a href="posix.constants.access.php#constant.posix-r-ok">POSIX_R_OK</a></code></strong>, <strong><code><a href="posix.constants.access.php#constant.posix-w-ok">POSIX_W_OK</a></code></strong> and
        <strong><code><a href="posix.constants.access.php#constant.posix-x-ok">POSIX_X_OK</a></code></strong>.
       </p>
       <p class="para">
        <strong><code><a href="posix.constants.access.php#constant.posix-r-ok">POSIX_R_OK</a></code></strong>, <strong><code><a href="posix.constants.access.php#constant.posix-w-ok">POSIX_W_OK</a></code></strong> and
        <strong><code><a href="posix.constants.access.php#constant.posix-x-ok">POSIX_X_OK</a></code></strong> request checking whether the file
        exists and has read, write and execute permissions, respectively.
        <strong><code><a href="posix.constants.access.php#constant.posix-f-ok">POSIX_F_OK</a></code></strong> just requests checking for the
        existence of the file.
       </p>
      </dd>
     
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.posix-access-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
   Restituisce <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> in caso di successo, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> in caso di fallimento.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.posix-access-examples">
  <h3 class="title">Esempi</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 <span class="function"><strong>posix_access()</strong></span> example</strong></p>
    <div class="example-contents"><p>
     This example will check if the $file is readable and writable, otherwise
     will print an error message.
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$file </span><span style="color: #007700">= </span><span style="color: #DD0000">'some_file'</span><span style="color: #007700">;<br /><br />if (</span><span style="color: #0000BB">posix_access</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">, </span><span style="color: #0000BB">POSIX_R_OK </span><span style="color: #007700">| </span><span style="color: #0000BB">POSIX_W_OK</span><span style="color: #007700">)) {<br />    echo </span><span style="color: #DD0000">'The file is readable and writable!'</span><span style="color: #007700">;<br /><br />} else {<br />    </span><span style="color: #0000BB">$error </span><span style="color: #007700">= </span><span style="color: #0000BB">posix_get_last_error</span><span style="color: #007700">();<br /><br />    echo </span><span style="color: #DD0000">"Error </span><span style="color: #0000BB">$error</span><span style="color: #DD0000">: " </span><span style="color: #007700">. </span><span style="color: #0000BB">posix_strerror</span><span style="color: #007700">(</span><span style="color: #0000BB">$error</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.posix-access-seealso">
  <h3 class="title">Vedere anche:</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.posix-get-last-error.php" class="function" rel="rdfs-seeAlso">posix_get_last_error()</a> - Recupera il numero di errore dell'ultima funzione
     posix non riuscita</span></li>
    <li><span class="function"><a href="function.posix-strerror.php" class="function" rel="rdfs-seeAlso">posix_strerror()</a> - Recupera il messaggio di errore di un dato codice di errore</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>