<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.filesystem.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.chown.php',
    1 => 'chown',
    2 => 'Cambia il proprietario del file',
  ),
  'up' => 
  array (
    0 => 'ref.filesystem.php',
    1 => 'Filesystem Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.chmod.php',
    1 => 'chmod',
  ),
  'next' => 
  array (
    0 => 'function.clearstatcache.php',
    1 => 'clearstatcache',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/filesystem/functions/chown.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.chown" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">chown</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">chown</span> &mdash; <span class="dc-title">Cambia il proprietario del file</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.chown-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>chown</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.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$user</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Tenta di cambiare il proprietario del file <code class="parameter">filename</code>
   nell&#039;utente <code class="parameter">user</code>. Solo il superuser può cambiare il
   proprietario di un file.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.chown-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">filename</code></dt>
     <dd>
      <p class="para">
       Percorso del file.
      </p>
     </dd>
    
    
     <dt><code class="parameter">user</code></dt>
     <dd>
      <p class="para">
       Un nome utente o un numero.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.chown-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.chown-examples">
  <h3 class="title">Esempi</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 Semplice utilizzo di <span class="function"><strong>chown()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">// Nome file e nome utente da utilizzare<br /></span><span style="color: #0000BB">$file_name</span><span style="color: #007700">= </span><span style="color: #DD0000">"foo.php"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$path </span><span style="color: #007700">= </span><span style="color: #DD0000">"/home/sites/php.net/public_html/sandbox/" </span><span style="color: #007700">. </span><span style="color: #0000BB">$file_name </span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$user_name </span><span style="color: #007700">= </span><span style="color: #DD0000">"root"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// Imposta l'utente<br /></span><span style="color: #0000BB">chown</span><span style="color: #007700">(</span><span style="color: #0000BB">$path</span><span style="color: #007700">, </span><span style="color: #0000BB">$user_name</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Controlla il risultato<br /></span><span style="color: #0000BB">$stat </span><span style="color: #007700">= </span><span style="color: #0000BB">stat</span><span style="color: #007700">(</span><span style="color: #0000BB">$path</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">posix_getpwuid</span><span style="color: #007700">(</span><span style="color: #0000BB">$stat</span><span style="color: #007700">[</span><span style="color: #DD0000">'uid'</span><span style="color: #007700">]));<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Il precedente esempio visualizzerà
qualcosa simile a:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Array
(
    [name] =&gt; root
    [passwd] =&gt; x
    [uid] =&gt; 0
    [gid] =&gt; 0
    [gecos] =&gt; root
    [dir] =&gt; /root
    [shell] =&gt; /bin/bash
)</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.chown-notes">
  <h3 class="title">Note</h3>
  <blockquote class="note"><p><strong class="note">Nota</strong>: <span class="simpara">Questa funzione non opererà su
<a href="features.remote-files.php" class="link">file remoti</a> perché il file che
deve essere esaminato deve essere accessibile attraverso il filesysmte del server.</span></p></blockquote>
  <blockquote class="note"><p><strong class="note">Nota</strong>: 
   <span class="simpara">
    Su Windows, questa funzione fallisce silenziosamente se applicata su un file normale.
   </span>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.chown-seealso">
  <h3 class="title">Vedere anche:</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.chmod.php" class="function" rel="rdfs-seeAlso">chmod()</a> - Cambia le impostazioni del file</span></li>
    <li><span class="function"><a href="function.chgrp.php" class="function" rel="rdfs-seeAlso">chgrp()</a> - Cambia il gruppo del file</span></li>
   </ul>
  </p>
 </div>


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