<?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.tempnam.php',
    1 => 'tempnam',
    2 => 'Crea file con unico nome file',
  ),
  'up' => 
  array (
    0 => 'ref.filesystem.php',
    1 => 'Filesystem Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.symlink.php',
    1 => 'symlink',
  ),
  'next' => 
  array (
    0 => 'function.tmpfile.php',
    1 => 'tmpfile',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/filesystem/functions/tempnam.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.tempnam" class="refentry">  
    <div class="refnamediv">  
     <h1 class="refname">tempnam</h1>  
     <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">tempnam</span> &mdash; <span class="dc-title">Crea file con unico nome file</span></p>
  
    </div>  
   <div class="refsect1 unknown-670" id="refsect1-function.tempnam-unknown-670">  
    <h3 class="title">Descrizionen</h3> 
      <div class="methodsynopsis dc-description">  
       <span class="methodname"><strong>tempnam</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$dir</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$prefix</code></span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>
  
      <p class="para rdfs-comment">  
       Crea un file con filename univoco nella directory specificata. 
       Se la directory non esiste, <span class="function"><strong>tempnam()</strong></span> può
       generare un file in una directory temporanea di sistema, e restituire
       il nome di quest&#039;ultima. 
      </p>  
       <p class="para">  
        Precedentemente al PHP 4.0.6, il comportamento della funzione <span class="function"><strong>tempnam()</strong></span> 
        dipendeva dal sistema. Su Windows  il dispositivo di variabli TMP sovrascrive il 
        <code class="parameter">dir</code> parametro, su Linux la variabile TMPDIR ha la precedenza, 
        mentre SVR4 utilizzerà sempre il parametro <code class="parameter">dir</code> se la directory 
        a cui punta, esiste. Consultare la vostra documentazione sulla funzione tempnam(3) in caso di dubbi. 
       </p>  
      <blockquote class="note"><p><strong class="note">Nota</strong>:   
       <span class="simpara">  
       Se PHP non può creare un file nello specificato <code class="parameter">dir</code>  
       parametro, ritorna al default di sistema. 
       </span>  
      </p></blockquote>  
      <p class="para">  
      Restituisce il nuovo nomefile temporaneo, o <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> in caso di 
      errore. 
      <div class="example" id="example-1">  
       <p><strong>Example #1 <span class="function"><strong>tempnam()</strong></span> esempio</strong></p>  
       <div class="example-contents"> 
       <div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php $tmpfname </span><span style="color: #007700">= </span><span style="color: #0000BB">tempnam</span><span style="color: #007700">(</span><span style="color: #DD0000">"/tmp"</span><span style="color: #007700">, </span><span style="color: #DD0000">"FOO"</span><span style="color: #007700">); <br />       <br />       </span><span style="color: #0000BB">$handle </span><span style="color: #007700">= </span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #0000BB">$tmpfname</span><span style="color: #007700">, </span><span style="color: #DD0000">"w"</span><span style="color: #007700">); <br />       </span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">, </span><span style="color: #DD0000">"writing to tempfile"</span><span style="color: #007700">); <br />       </span><span style="color: #0000BB">fclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$handle</span><span style="color: #007700">); <br />       <br />       </span><span style="color: #FF8000">// do here something <br />       <br />       </span><span style="color: #0000BB">unlink</span><span style="color: #007700">(</span><span style="color: #0000BB">$tmpfname</span><span style="color: #007700">); <br />       </span><span style="color: #0000BB">?&gt;</span></span></code></div>  
              </div>
  
             </div>  
            </p>  
            <blockquote class="note"><p><strong class="note">Nota</strong>:   
             <span class="simpara">  
             Il funzionamento di questa funzione è cambiato nella 4.0.3. Il file temporaneo
             è creato inoltre èer evitare un conflitto dove il file dovrebbe apparire 
             nel filesystem tra la volta in cui la stringa viene generata
             e prima che lo script tenti di creare il file. Notare che se si necessita 
             cancellare il file, se non servisse più, non viene fatto
             automaticamente.
             </span>  
            </p></blockquote>  
            <p class="para">  
             Vedere anche <span class="function"><a href="function.tmpfile.php" class="function">tmpfile()</a></span> and <span class="function"><a href="function.unlink.php" class="function">unlink()</a></span>. 
             </p>  
            </div>
  
           </div><?php manual_footer($setup); ?>