cvs: phpdoc-it /reference/filesystem/functions chmod.xml clearstatcache.xml fread.xml fseek.xml fstat.xml fwrite.xml lstat.xml mkdir.xml
parse-ini-file.xml pathinfo.xml pclose.xml popen.xml readfile.xml readlink.xml realpath.xml rename.xml rewind.xml rmdir.xml set-file-buffer.xml
stat.xml symlink.xml tempnam.xml tmpfile.xml touch.xml umask.xml unlink.xml
| From: | Andrioli Darvin | Date: | Fri, 13 Feb 2004 20:47:23 +0000 |
| Subject: | cvs: phpdoc-it /reference/filesystem/functions chmod.xml clearstatcache.xml fread.xml fseek.xml fstat.xml fwrite.xml lstat.xml mkdir.xml parse-ini-file.xml pathinfo.xml pclose.xml popen.xml readfile.xml readlink.xml realpath.xml rename.xml rewind.xml rmdir.xml set-file-buffer.xml stat.xml symlink.xml tempnam.xml tmpfile.xml touch.xml umask.xml unlink.xml |
||
| Groups: | php.doc.it | ||
| Request: | Send a blank email to doc-it+get-549@lists.php.net to get a copy of this message | ||
darvina Fri Feb 13 15:47:23 2004 EDT
Modified files:
/phpdoc-it/reference/filesystem/functions chmod.xml
clearstatcache.xml
fread.xml fseek.xml
fstat.xml fwrite.xml
lstat.xml mkdir.xml
parse-ini-file.xml
pathinfo.xml pclose.xml
popen.xml readfile.xml
readlink.xml realpath.xml
rename.xml rewind.xml
rmdir.xml
set-file-buffer.xml
stat.xml symlink.xml
tempnam.xml tmpfile.xml
touch.xml umask.xml
unlink.xml
Log:
Sync to En tree
http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/chmod.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-it/reference/filesystem/functions/chmod.xml diff -u phpdoc-it/reference/filesystem/functions/chmod.xml:1.4 phpdoc-it/reference/filesystem/functions/chmod.xml:1.5 --- phpdoc-it/reference/filesystem/functions/chmod.xml:1.4 Fri Oct 10 15:48:59 2003 +++ phpdoc-it/reference/filesystem/functions/chmod.xml Fri Feb 13 15:47:23 2004 @@ -41,7 +41,7 @@ <para> Il parametro <parameter>mode</parameter> consiste in tre numeri ottali costituenti le restrizioni dell'accesso per il proprietario, - il gruppo utente a cui appartiene il proprietrio, e gli altri. + il gruppo utente a cui appartiene il proprietario, e gli altri. Ciascun numero può essere calcolato aggiungendo i permessi al valore base per l'utente. Il numero 1 indica che si abilita all'esecuzione del file, con il numero 2 si assegnano i diritti di scrittura, con il numero 4 @@ -54,16 +54,16 @@ <programlisting role="php"> <![CDATA[ <?php -// Lettura e scrittura per il proprietatio, e nessun permesso per gli altri +// Lettura e scrittura per il proprietario, e nessun permesso per gli altri chmod ("/somedir/somefile", 0600); -// Lettura e scrittura per il proprietatio, e lettura per gli altri +// Lettura e scrittura per il proprietario, e lettura per gli altri chmod ("/somedir/somefile", 0644); -// Accesso completo per il proprietatio, e lettura ed esecuzione per gli altri +// Accesso completo per il proprietario, e lettura ed esecuzione per gli altri chmod ("/somedir/somefile", 0755); -// Accesso completo per il proprietatio, e lettura ed esecuzione per il gruppo del proprietario +// Accesso completo per il proprietario, e lettura ed esecuzione per il gruppo del proprietario chmod ("/somedir/somefile", 0750); ?> ]]> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/clearstatcache.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-it/reference/filesystem/functions/clearstatcache.xml diff -u phpdoc-it/reference/filesystem/functions/clearstatcache.xml:1.3 phpdoc-it/reference/filesystem/functions/clearstatcache.xml:1.4 --- phpdoc-it/reference/filesystem/functions/clearstatcache.xml:1.3 Fri Oct 10 15:48:59 2003 +++ phpdoc-it/reference/filesystem/functions/clearstatcache.xml Fri Feb 13 15:47:23 2004 @@ -15,7 +15,7 @@ Quando si eseguono le funzioni di sistema <systemitem>stat</systemitem> o <systemitem>lstat</systemitem> o una delle funzioni elencate nella lista delle funzioni coinvolte (vedi sotto), il PHP memorizza le informazioni restituite - da queste funzioni in modo da fornire mgliori performance. Esistono, tuttavia, + da queste funzioni in modo da fornire migliori performance. Esistono, tuttavia, casi in cui si desidera rimuovere le informazioni memorizzate. Ad esempio, nel caso in cui un file venga controllato più volte nel medesimo script ed il file si trova in situazioni in cui possa venire rimosso o possa essere variato durante l'esecuzione dello script; in questi casi http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/fread.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/fread.xml diff -u phpdoc-it/reference/filesystem/functions/fread.xml:1.2 phpdoc-it/reference/filesystem/functions/fread.xml:1.3 --- phpdoc-it/reference/filesystem/functions/fread.xml:1.2 Wed Apr 17 03:06:38 2002 +++ phpdoc-it/reference/filesystem/functions/fread.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'fread' in en/ tree in rev 1.25 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.25 --> +<!-- EN-Revision: 1.15 Maintainer: cortesi Status: working --> <refentry id="function.fread"> <refnamediv> <refname>fread</refname> @@ -12,48 +9,99 @@ <title>Descrizione</title> <methodsynopsis> <type>string</type><methodname>fread</methodname> - <methodparam><type>int</type><parameter>fp</parameter></methodparam> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> <methodparam><type>int</type><parameter>length</parameter></methodparam> </methodsynopsis> <simpara> <function>fread</function> legge fino a <parameter>length</parameter> byte dal puntatore al file - indicato da <parameter>fp</parameter>. La lettura finisce quando sono stati letti - <parameter>length</parameter> byte o è stata raggiunta EOF, - qualora giunga prima. + indicato da <parameter>handle</parameter>. La lettura finisce quando sono stati letti + <parameter>length</parameter> byte o è stata raggiunta EOF, o (nel caso di flussi + via rete) quando un pacchetto divnta disponibile, + in base a quale evento accada prima. </simpara> <para> <informalexample> <programlisting role="php"> <![CDATA[ +<?php // copia il contenuto di un file in una stringa $filename = "/usr/local/something.txt"; -$fd = fopen ($filename, "r"); -$contents = fread ($fd, filesize ($filename)); -fclose ($fd); +$handle = fopen($filename, "r"); +$contents = fread($handle, filesize($filename)); +fclose($handle); +?> ]]> </programlisting> </informalexample> </para> - <note> + <warning> <para> Sui sistemi che differenziano fra file di testo e binari (ad esempio Windows) il file deve essere aperto con il parametro mode di <function>fopen</function> impostato a 'b'. </para> - </note> + </warning> <para> <informalexample> <programlisting role="php"> <![CDATA[ +<?php $filename = "c:\\files\\somepic.gif"; -$fd = fopen ($filename, "rb"); -$contents = fread ($fd, filesize ($filename)); -fclose ($fd); +$handle = fopen($filename, "rb"); +$contents = fread($handle, filesize($filename)); +fclose($handle); +?> +]]> + </programlisting> + </informalexample> + </para> + + <warning> + <para> + Quando si ricevono dati via rete o pipe, tipo quelli ottenuti leggendo da + <link linkend="features.remote-files">file remoti</link> o da + <function>popen</function> e <function>proc_open</function>, la lettura + si fermerà dopo avere ricevuto il pacchetto disponibile. + Questo significa che i dati sono ricevuti a blocchi + che devono essere raggruppati, come illustrato nell'esempio seguente. + </para> + </warning> + <para> + <informalexample> + <programlisting role="php"> +<![CDATA[ +<?php +$handle = fopen("http://www.example.com/", "rb"); +$contents = ""; +do { + $data = fread($handle, 8192); + if (strlen($data) == 0) { + break; + } + $contents .= $data; +} while (true); +fclose($handle); +?> ]]> + </programlisting> </informalexample> </para> + <note> + <para> + L'esempio precedente ottiene migliori performance rispetto al tradizionale approccio + tramite while(!<function>feof</function>), poichè si risparmia l'overhead + della chiamata per la funzione di iterazione. + </para> + </note> + <note> + <para> + Se si desidera ottenere il contenuto del file in una stringa, utilizzare + la funzione <function>file_get_contents</function> la quale è ancora più + performante del codice precedente. + </para> + </note> <simpara> Vedere anche <function>fwrite</function>, <function>fopen</function>, <function>fsockopen</function>, <function>popen</function>, http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/fseek.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/fseek.xml diff -u phpdoc-it/reference/filesystem/functions/fseek.xml:1.2 phpdoc-it/reference/filesystem/functions/fseek.xml:1.3 --- phpdoc-it/reference/filesystem/functions/fseek.xml:1.2 Wed Apr 17 03:06:38 2002 +++ phpdoc-it/reference/filesystem/functions/fseek.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'fseek' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.7 Maintainer: cortesi Status: working --> <refentry id="function.fseek"> <refnamediv> <refname>fseek</refname> @@ -12,33 +10,55 @@ <title>Descrizione</title> <methodsynopsis> <type>int</type><methodname>fseek</methodname> - <methodparam><type>int</type><parameter>fp</parameter></methodparam> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> <methodparam><type>int</type><parameter>offset</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>whence</parameter></methodparam> </methodsynopsis> <para> Imposta l'indicatore di posizione del file riferito da - <parameter>fp</parameter>. La nuova posizione, misurata in byte + <parameter>handle</parameter>. La nuova posizione, misurata in byte dall'inizio del file, viene ottenuta aggiungento <parameter>offset</parameter> alla posizione specificata da <parameter>whence</parameter>, i cui valori sono definiti come segue: <simplelist> - <member>SEEK_SET - Imposta la posizione uguale a <parameter>offset</parameter> byte.</member> - <member>SEEK_CUR - Imposta la posizione alla attuale più <parameter>offset</parameter>.</member> - <member>SEEK_END - Imposta la posizione alla fine del file più <parameter>offset</parameter>. + <member><constant>SEEK_SET</constant> - Imposta la posizione uguale a <parameter>offset</parameter> byte.</member> + <member><constant>SEEK_CUR</constant> - Imposta la posizione alla attuale più <parameter>offset</parameter>.</member> + <member><constant>SEEK_END</constant> - Imposta la posizione alla fine del file più <parameter>offset</parameter>. (To move to a position before the end-of-file, you need to pass a negative value in <parameter>offset</parameter>.)</member> </simplelist> </para> - <para>Se <parameter>whence</parameter> non viene specificato, viene assunto come - SEEK_SET. + <para> + Se <parameter>whence</parameter> non viene specificato, viene assunto come + <constant>SEEK_SET</constant>. </para> <para> In caso di successo, restituisce 0; altrimenti, restituisce -1. Nota che spostarsi oltre EOF non è considerato un errore. </para> <para> + <example> + <title>Esempio di uso di <function>fseek</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +$fp = fopen('somefile.txt'); + +// Lettura di qualche dato +$data = fgets($fp, 4096); + +// si torna ad inizio file +// come rewind($fp); +fseek($fp, 0); + +?> +]]> + </programlisting> + </example> + </para> + <para> Non può essere usato su puntatori a file restituiti da <function>fopen</function> se è in uso il formato "http://" o "ftp://". http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/fstat.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/fstat.xml diff -u phpdoc-it/reference/filesystem/functions/fstat.xml:1.2 phpdoc-it/reference/filesystem/functions/fstat.xml:1.3 --- phpdoc-it/reference/filesystem/functions/fstat.xml:1.2 Wed Apr 17 03:06:38 2002 +++ phpdoc-it/reference/filesystem/functions/fstat.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'fstat' in en/ tree in rev 1.24 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.24 --> +<!-- EN-Revision: 1.8 Maintainer: cortesi Status: working --> <refentry id="function.fstat"> <refnamediv> <refname>fstat</refname> @@ -12,38 +10,70 @@ <title>Descrizione</title> <methodsynopsis> <type>array</type><methodname>fstat</methodname> - <methodparam><type>int</type><parameter>fp</parameter></methodparam> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> </methodsynopsis> <para> - Restituisce le statistiche del file aperto dal puntatore fp. + Restituisce le statistiche del file aperto dal puntatore <parameter>handle</parameter>. Questa funzione è simile a <function>stat</function> eccetto per il fatto che opera su un puntatore a file aperto invece che su un nome di file. </para> <para> - Restituisce un vettore con le statistiche del file con i - seguenti elementi: - <orderedlist> - <listitem><simpara>device</simpara></listitem> - <listitem><simpara>inode</simpara></listitem> - <listitem><simpara>numero di link</simpara></listitem> - <listitem><simpara>user id del proprietario</simpara></listitem> - <listitem><simpara>group id del proprietario</simpara></listitem> - <listitem><simpara>tipo di device se è presente l'inode device *</simpara></listitem> - <listitem><simpara>dimensione in byte</simpara></listitem> - <listitem><simpara>ora dell'ultimo accesso</simpara></listitem> - <listitem><simpara>ora dell'ultima modifica</simpara></listitem> - <listitem><simpara>ora del ultimo cambiamento</simpara></listitem> - <listitem><simpara>blocksize per l'I/O del filesystem *</simpara></listitem> - <listitem><simpara>numero di blocchi allocati</simpara></listitem> - </orderedlist> - * - valido solo su sistemi che supportano il tipo st_blksize --negli altri sistemi - (per esempio Windows) restituisce -1 - </para> + Restituisce un vettore con le statistiche del file con il formato + del vettore è descritto nella pagina di <function>stat</function>. + </para> <para> - I risultati di questa funzione vengono memorizzati nella cache. Vedi - <function>clearstatcache</function> per maggiori informazioni. + <example> + <title>Esempio di uso di <function>fstat</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +// apertura del file +$fp = fopen("/etc/passwd", "r"); + +// raccolta delle informazioni +$fstat = fstat($fp); + +// chiusura del file +fclose($fp); + +// scrittura della sola parte associativa +print_r(array_slice($fstat, 13)); + +?> +]]> + </programlisting> + <para> + l'esempio visualizzerà : + </para> + <screen> +<![CDATA[ +Array +( + [dev] => 771 + [ino] => 488704 + [mode] => 33188 + [nlink] => 1 + [uid] => 0 + [gid] => 0 + [rdev] => 0 + [size] => 1114 + [atime] => 1061067181 + [mtime] => 1056136526 + [ctime] => 1056136526 + [blksize] => 4096 + [blocks] => 8 +) +]]> + </screen> + </example> </para> + + ¬e.clearstatcache; + + ¬e.no-remote; + </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/fwrite.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/fwrite.xml diff -u phpdoc-it/reference/filesystem/functions/fwrite.xml:1.2 phpdoc-it/reference/filesystem/functions/fwrite.xml:1.3 --- phpdoc-it/reference/filesystem/functions/fwrite.xml:1.2 Wed Apr 17 03:06:39 2002 +++ phpdoc-it/reference/filesystem/functions/fwrite.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'fwrite' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.8 Maintainer: cortesi Status: working --> <refentry id="function.fwrite"> <refnamediv> <refname>fwrite</refname> @@ -12,14 +10,14 @@ <title>Descrizione</title> <methodsynopsis> <type>int</type><methodname>fwrite</methodname> - <methodparam><type>int</type><parameter>fp</parameter></methodparam> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> <methodparam><type>string</type><parameter>string</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>length</parameter></methodparam> </methodsynopsis> <simpara> <function>fwrite</function> scrive il contenuto di <parameter>string</parameter> nel flusso del file puntato da - <parameter>fp</parameter>. Se l'argomento <parameter>length</parameter> + <parameter>handle</parameter>. Se l'argomento <parameter>length</parameter> è specificato la scrittura si arresterà dopo aver scritto <parameter>length</parameter> byte o alla fine di <parameter>string</parameter> se si verificasse @@ -27,7 +25,7 @@ </simpara> <simpara> <function>fwrite</function> returns the number of bytes - written, or -1 on error. + written, or &false; on error. </simpara> <simpara> Nota che se il parametro <parameter>length</parameter> viene specificato, @@ -43,6 +41,44 @@ <function>fopen</function>. </para> </note> + <para> + <example> + <title>Un semplice esempio di fwrite</title> + <programlisting role="php"> +<![CDATA[ +<?php +$filename = 'test.txt'; +$somecontent = "Aggiunge questa riga al file\n"; + +// Verifica che il file esista e sia riscrivibile +if (is_writable($filename)) { + + // In questo esempio apriamo $filename in append mode. + // Il puntatore del file è posizionato in fondo al file + // è qui che verrà posizionato $somecontent quando eseguiremo fwrite(). + if (!$handle = fopen($filename, 'a')) { + echo "Non si riesce ad aprire il file ($filename)"; + exit; + } + + // Scrive $somecontent nel file aperto. + if (!fwrite($handle, $somecontent)) { + echo "Non si riesce a scrivere nel file ($filename)"; + exit; + } + + echo "Riuscito, scritto ($somecontent) nel file ($filename)"; + + fclose($handle); + +} else { + echo "Il file $filename non è accessibile"; +} +?> +]]> + </programlisting> + </example> + </para> <simpara> Vedere anche <function>fread</function>, <function>fopen</function>, <function>fsockopen</function>, <function>popen</function> e http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/lstat.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/lstat.xml diff -u phpdoc-it/reference/filesystem/functions/lstat.xml:1.2 phpdoc-it/reference/filesystem/functions/lstat.xml:1.3 --- phpdoc-it/reference/filesystem/functions/lstat.xml:1.2 Wed Apr 17 03:06:40 2002 +++ phpdoc-it/reference/filesystem/functions/lstat.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'lstat' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: working --> <refentry id="function.lstat"> <refnamediv> <refname>lstat</refname> @@ -16,41 +14,19 @@ </methodsynopsis> <para> Raccoglie le statistiche del file o del link simbolico chiamato - filename. Questa funzione è identica alla funzione + <parameter>filename</parameter>.. Questa funzione è identica alla funzione <function>stat</function> eccetto che se il paramametro <parameter>filename</parameter> è un link simbolico valido, viene restituito lo stato del link simbolico, non lo stato del file puntato dal link simbolico. </para> - <para> - Restituisce un vettore con le statistiche del file con i - seguenti elementi: - <orderedlist> - <listitem><simpara>device</simpara></listitem> - <listitem><simpara>inode</simpara></listitem> - <listitem><simpara>modalità di protezione dell'inode</simpara></listitem> - <listitem><simpara>numero di link</simpara></listitem> - <listitem><simpara>ID utente del proprietario</simpara></listitem> - <listitem><simpara>ID del gruppo del proprietario</simpara></listitem> - <listitem><simpara>tipo di device con l'inode device *</simpara></listitem> - <listitem><simpara>dimensione in byte</simpara></listitem> - <listitem><simpara>ora dell'ultimo aggesso</simpara></listitem> - <listitem><simpara>ora del'ultima modifica</simpara></listitem> - <listitem><simpara>ora dell'ultimo cambiamento</simpara></listitem> - <listitem><simpara>dimensione del blocco per l'I/O di filesystem *</simpara></listitem> - <listitem><simpara>numero dei blocchi allocati</simpara></listitem> - </orderedlist> - * - valida solo su sistemi che supportano il tipo st_blksize--altri sistemi - (ad esempio Windows) restituiscono -1. - </para> - <para> - <function>lstat</function> cannot be used on <link - linkend="features.remote-files">remote files</link>. - </para> - <para> - I risultati di questa funzione vengono memorizzati nella cache. Vedi - <function>clearstatcache</function> per maggiori informazioni. - </para> + ¬e.clearstatcache; + + &tip.fopen-wrapper.stat; + + <simpara> + Vedere anche <function>stat</function>. + </simpara> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/mkdir.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/mkdir.xml diff -u phpdoc-it/reference/filesystem/functions/mkdir.xml:1.2 phpdoc-it/reference/filesystem/functions/mkdir.xml:1.3 --- phpdoc-it/reference/filesystem/functions/mkdir.xml:1.2 Wed Apr 17 03:06:40 2002 +++ phpdoc-it/reference/filesystem/functions/mkdir.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'mkdir' in en/ tree in rev 1.39 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.39 --> +<!-- EN-Revision: 1.12 Maintainer: cortesi Status: working --> <refentry id="function.mkdir"> <refnamediv> <refname>mkdir</refname> @@ -13,7 +11,8 @@ <methodsynopsis> <type>int</type><methodname>mkdir</methodname> <methodparam><type>string</type><parameter>pathname</parameter></methodparam> - <methodparam><type>int</type><parameter>mode</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>mode</parameter></methodparam> + <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> </methodsynopsis> <para> Tenta di creare la directory specificata da pathname. @@ -23,17 +22,44 @@ iniziare con uno zero. La modalità è anche modificata dall'umask corrente, che puoi cambiare con <function>umask</function>. + </para> + <para> + <note> + <para> + Il parametro mode è ignorato sui sistemi Windows, ed è opzionale dal PHP 4.2.0. + </para> + </note> + </para> + <para> + Il parametro mode viene impostato a 0777 per default; ciò significa dare i maggiori + accessi possibili. Per maggiori dettagli sui valori di mode, leggere le pagine + relative a <function>chmod</function>. <informalexample> <programlisting role="php"> <![CDATA[ -mkdir ("/path/to/my/dir", 0700); +<?php +mkdir("/path/to/my/dir", 0700); +?> ]]> </programlisting> </informalexample> </para> <para> - Restituisce &true; se ha successo e &false; se fallisce. + &return.success; </para> + <note> + <simpara> + A partire da <literal>PHP 5.0.0</literal> la funzione <function>mkdir</function> può anche essere + utilizzata con <emphasis>alcuni</emphasis> wrapper url. Fare riferimento a <xref linkend="wrappers"/> + per avere l'elenco dei wrapper supportati da <function>mkdir</function>. + </simpara> + </note> + <note> + <simpara> + Il parametro <parameter>context</parameter> è stato aggiunto in <literal>PHP 5.0.0</literal>. + </simpara> + </note> + ¬e.sm.uidcheck.dir; <para> Vedere anche <function>rmdir</function>. </para> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/parse-ini-file.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/parse-ini-file.xml diff -u phpdoc-it/reference/filesystem/functions/parse-ini-file.xml:1.2 phpdoc-it/reference/filesystem/functions/parse-ini-file.xml:1.3 --- phpdoc-it/reference/filesystem/functions/parse-ini-file.xml:1.2 Wed Apr 17 03:06:40 2002 +++ phpdoc-it/reference/filesystem/functions/parse-ini-file.xml Fri Feb 13 15:47:23 2004 @@ -1,89 +1,116 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'parse-ini-file' in en/ tree in rev 1.87 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.87 --> +<!-- EN-Revision: 1.16 Maintainer: darvina Status: ready --> +<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.87 --> <refentry id="function.parse-ini-file"> <refnamediv> <refname>parse_ini_file</refname> - <refpurpose>Parse a configuration file</refpurpose> + <refpurpose>Legge il file di configurazione</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrizione</title> <methodsynopsis> <type>array</type><methodname>parse_ini_file</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>process_sections</parameter></methodparam> </methodsynopsis> <para> - <function>parse_ini_file</function> loads in the - ini file specified in <parameter>filename</parameter>, - and returns the settings in it in an associative array. - By setting the last <parameter>process_sections</parameter> - parameter to &true;, you get a multidimensional array, with - the section names and settings included. The default - for <parameter>process_sections</parameter> is &false; + La funzione <function>parse_ini_file</function> carica il file ini + specificato da <parameter>filename</parameter>, + e restituisce le impostazioni in un array associativo. + Impostando <parameter>process_sections</parameter> a &true; + si ottiene una matrice multi-dimensionale con in nomi + delle sezioni e le impostazioni ivi incluse. Per default + <parameter>process_sections</parameter> è impostato a falso &false; </para> <note> <para> - This function has nothing to do with the - <filename>php.ini</filename> file. It is already processed, - the time you run your script. This function can be used to - read in your own application's configuration files. + Questa funzione non è collegata con il file + &php.ini;. Questo è già elaborato + al momento in cui gira lo script. Questa funzione può essere utilizzata + per leggere i file ini propri dell'applicazione. </para> </note> + <note> + <para> + Se in un valore il file ini contiene caratteri non alfanumerici + questi debbono essere delitimitati dai doppi apici ("). + </para> + </note> + <note> + <simpara> + Dalla versione 4.2.1 di PHP questa funzione è limitata da by &safemode; + e da <link linkend="ini.open-basedir">open_basedir</link>. + </simpara> + </note> + <note> + <simpara> + Esistono parole riservate che non possono essere utilizzare come chiavi + nei file ini. Queste includono: null, yes, no, true, and false. + + </simpara> + </note> <para> - The structure of the ini file is similar to that of - the <filename>php.ini</filename>'s. + La struttura del file ini è simile a quella del + &php.ini;. + </para> + <para> + Le <link linkend="language.constants">Costanti</link> possono essere definite + in un file ini, quindi se si definisce la costante come un valore da file ini + prima di eseguire <function>parse_ini_file</function>, la funzione integrerà nella costante + il valore letto. Saranno considerati solo i valori ini. Ad esempio: </para> <para> <example> - <title>Contents of sample.ini</title> + <title>Contenuto di <filename>sample.ini</filename></title> <programlisting> <![CDATA[ -; This is a sample configuration file -; Comments start with ';', as in php.ini +; Questo è un esempio di file di configurazione +; I commenti cominciano con ';', come in php.ini [first_section] one = 1 five = 5 +animal = BIRD [second_section] path = /usr/local/bin +URL = "http://www.example.com/~username" ]]> </programlisting> </example> </para> <para> <example> - <title><function>parse_ini_file</function> example</title> - <programlisting> + <title>Esempio di uso di <function>parse_ini_file</function></title> + <programlisting role="php"> <![CDATA[ <?php -// Parse without sections +define('BIRD', 'Dodo bird'); + +// Lettura senza sezioni $ini_array = parse_ini_file("sample.ini"); print_r($ini_array); -// Parse with sections -$ini_array = parse_ini_file("sample.ini", TRUE); +// Lettura con sezioni +$ini_array = parse_ini_file("sample.ini", true); print_r($ini_array); ?> ]]> </programlisting> - </example> - </para> - <para> - Would produce: - <informalexample> - <programlisting> + <para> + L'esempio produrrà: + </para> + <screen> <![CDATA[ Array ( [one] => 1 [five] => 5 + [animal] => Dodo bird [path] => /usr/local/bin + [URL] => http://www.example.com/~username ) Array ( @@ -91,17 +118,19 @@ ( [one] => 1 [five] => 5 + [animal] = Dodo bird ) [second_section] => Array ( [path] => /usr/local/bin + [URL] => http://www.example.com/~username ) ) ]]> - </programlisting> - </informalexample> + </screen> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/pathinfo.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/pathinfo.xml diff -u phpdoc-it/reference/filesystem/functions/pathinfo.xml:1.2 phpdoc-it/reference/filesystem/functions/pathinfo.xml:1.3 --- phpdoc-it/reference/filesystem/functions/pathinfo.xml:1.2 Wed Apr 17 03:06:40 2002 +++ phpdoc-it/reference/filesystem/functions/pathinfo.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'pathinfo' in en/ tree in rev 1.61 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.61 --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: working --> <refentry id="function.pathinfo"> <refnamediv> <refname>pathinfo</refname> @@ -37,20 +35,25 @@ ?> ]]> </programlisting> - </example> - </para> - <para> - produrra: - <informalexample> - <programlisting> + <para> + produrra: + </para> + <screen> <![CDATA[ /www/htdocs index.html html ]]> - </programlisting> - </informalexample> + </screen> + </example> </para> + <note> + <para> + Per maggiori dettagli sul recupero del percorso corrente, leggere + la sezione <link linkend="language.variables.predefined"> + variabili predefinite riservate</link>. + </para> + </note> <para> Vedere anche <function>dirname</function>, <function>basename</function>, <function>parse_url</function> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/pclose.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/pclose.xml diff -u phpdoc-it/reference/filesystem/functions/pclose.xml:1.2 phpdoc-it/reference/filesystem/functions/pclose.xml:1.3 --- phpdoc-it/reference/filesystem/functions/pclose.xml:1.2 Wed Apr 17 03:06:41 2002 +++ phpdoc-it/reference/filesystem/functions/pclose.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'pclose' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: working --> <refentry id="function.pclose"> <refnamediv> <refname>pclose</refname> @@ -12,7 +10,7 @@ <title>Descrizione</title> <methodsynopsis> <type>int</type><methodname>pclose</methodname> - <methodparam><type>int</type><parameter>fp</parameter></methodparam> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> </methodsynopsis> <para> Chiude un puntatore ad una pipe aperto da http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/popen.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/popen.xml diff -u phpdoc-it/reference/filesystem/functions/popen.xml:1.2 phpdoc-it/reference/filesystem/functions/popen.xml:1.3 --- phpdoc-it/reference/filesystem/functions/popen.xml:1.2 Wed Apr 17 03:06:41 2002 +++ phpdoc-it/reference/filesystem/functions/popen.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'popen' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.11 Maintainer: cortesi Status: working --> <refentry id="function.popen"> <refnamediv> <refname>popen</refname> @@ -11,7 +9,7 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>int</type><methodname>popen</methodname> + <type>resource</type><methodname>popen</methodname> <methodparam><type>string</type><parameter>command</parameter></methodparam> <methodparam><type>string</type><parameter>mode</parameter></methodparam> </methodsynopsis> @@ -30,40 +28,57 @@ <para> Se si verifica un errore, restituisce &false;. </para> + <note> + <para> + Se si sta cercando un supporto bi-direzionale (2 vie), utilizzare + <function>proc_open</function>. + </para> + </note> <para> - <informalexample> + <example> + <title>Esempio di uso di <function>popen</function></title> <programlisting role="php"> <![CDATA[ -$fp = popen ("/bin/ls", "r"); +<?php +$handle = popen("/bin/ls", "r"); +?> ]]> </programlisting> - </informalexample> + </example> </para> - <note> - <para> - If the command to be executed could not be found, a valid - resource is returned. This may seem odd, but makes sense; it - allows you to access any error message returned by the shell: - <informalexample> - <programlisting role="php"> + <para> + Se il comando che deve essere eseguito non è trovato, la funzione + restituisce una risorsa valida. Questo sembra strano, ma ha un senso; + esso permette di accedere ai messaggi di erore restituiti dalla shell: + <informalexample> + <programlisting role="php"> <![CDATA[ <?php error_reporting(E_ALL); -/* Add redirection so we can get stderr. */ -$fp = popen('/path/to/spooge 2>&1', 'r'); -echo "'$fp'; " . gettype($fp) . "\n"; -$read = fread($fp, 2096); +/* Aggiunge una redirezione, così possiamo ottenere stderr. */ +$handle = popen('/path/to/spooge 2>&1', 'r'); +echo "'$handle'; " . gettype($handle) . "\n"; +$read = fread($handle, 2096); echo $read; -pclose($fp); +pclose($handle); ?> ]]> </programlisting> </informalexample> </para> + <note> + <simpara> + Quando è abilitato il <link linkend="features.safe-mode">safe mode</link> + si possono eseguire solo gli eseguibili presenti nella directoy <link + linkend="ini.safe-mode-exec-dir">safe_mode_exec_dir</link>. + Per ragioni pratiche, attualmente, non è consentito avere + <literal>..</literal> nel percorso dell'eseguibile. + </simpara> </note> <para> - Vedere anche <function>pclose</function>. + Vedere anche <function>pclose</function>, <function>fopen</function> + e <function>proc_open</function>. </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/readfile.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/readfile.xml diff -u phpdoc-it/reference/filesystem/functions/readfile.xml:1.2 phpdoc-it/reference/filesystem/functions/readfile.xml:1.3 --- phpdoc-it/reference/filesystem/functions/readfile.xml:1.2 Wed Apr 17 03:06:41 2002 +++ phpdoc-it/reference/filesystem/functions/readfile.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'readfile' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: working --> <refentry id="function.readfile"> <refnamediv> <refname>readfile</refname> @@ -13,7 +11,8 @@ <methodsynopsis> <type>int</type><methodname>readfile</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>use_include_path</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>use_include_path</parameter></methodparam> + <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> </methodsynopsis> <para> Legge un file e lo scrive nello standard output. @@ -21,39 +20,20 @@ <para> Restituisce il numero di byte letti dal file. Se si verifica un errore viene restituito &false; e se la funzione non è stata chiamata come - @readfile, un messaggio d'errore verra stampato. + @<function>readfile</function>, un messaggio d'errore verra stampato. </para> + &tip.fopen-wrapper; <para> - Se <parameter>filename</parameter> inzia con "http://" - (case insensitive), viene aperta una connessione HTTP 1.0 al server - specificato e il testo della risposta viene scritto nello stadard - output. - </para> - <para> - Versioni precedenti al PHP 4.0.5 non considera le redirezioni HTTP. - Perciò, le directory devono includere gli slash finali. - </para> - <para> - Se <parameter>filename</parameter> inizia con "ftp://" - (case insensitive), viene aperta una connessione ftp al server specificato - e il file richiesto viene stampato sullo standard output. Se il server - non supporta l'ftp passivo, questa funzione fallirà. - </para> - <para> - Se <parameter>filename</parameter> non inizia con tali stringhe, - il file verrà apperto dal filesystem e il suo - contenuto verrà scritto nello standard output. - </para> - <para> - Puoi settare il secondo parametro opzionale ad "1", se + Puoi settare il secondo parametro opzionale ad &true;, se vuoi anche cercare il file nella <link linkend="ini.include-path">include_path</link>. </para> <para> Vedere anche <function>fpassthru</function>, <function>file</function>, <function>fopen</function>, - <function>include</function>, <function>require</function> e - <function>virtual</function>. + <function>include</function>, <function>require</function> + <function>virtual</function>, <function>file_get_contents</function> + e <xref linkend="wrappers"/>. </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/readlink.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/readlink.xml diff -u phpdoc-it/reference/filesystem/functions/readlink.xml:1.2 phpdoc-it/reference/filesystem/functions/readlink.xml:1.3 --- phpdoc-it/reference/filesystem/functions/readlink.xml:1.2 Wed Apr 17 03:06:41 2002 +++ phpdoc-it/reference/filesystem/functions/readlink.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'readlink' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: working --> <refentry id="function.readlink"> <refnamediv> <refname>readlink</refname> @@ -20,11 +18,24 @@ in caso d'errore. </para> <para> + <example> + <title>Esempio di uso di <function>readlink</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// ad esempio visualizza /boot/vmlinux-2.4.20-xfs +echo readlink('/vmlinuz'); + +?> +]]> + </programlisting> + </example> + </para> + <para> Vedere anche <function>symlink</function>, <function>readlink</function> e <function>linkinfo</function>. </para> - ¬e.no-windows; </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/realpath.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-it/reference/filesystem/functions/realpath.xml diff -u phpdoc-it/reference/filesystem/functions/realpath.xml:1.3 phpdoc-it/reference/filesystem/functions/realpath.xml:1.4 --- phpdoc-it/reference/filesystem/functions/realpath.xml:1.3 Tue Apr 23 05:40:41 2002 +++ phpdoc-it/reference/filesystem/functions/realpath.xml Fri Feb 13 15:47:23 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: working --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: working --> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> <refentry id="function.realpath"> <refnamediv> @@ -28,7 +28,9 @@ <title>Esempio di <function>realpath</function></title> <programlisting role="php"> <![CDATA[ -$real_path = realpath ("../../index.php"); +<?php +$real_path = realpath("../../index.php"); +?> ]]> </programlisting> </example> @@ -36,7 +38,7 @@ <para> Vedere anche: <function>basename</function>, <function>dirname</function> e - <function>path_info</function>. + <function>pathinfo</function>. </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/rename.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/rename.xml diff -u phpdoc-it/reference/filesystem/functions/rename.xml:1.2 phpdoc-it/reference/filesystem/functions/rename.xml:1.3 --- phpdoc-it/reference/filesystem/functions/rename.xml:1.2 Wed Apr 17 03:06:41 2002 +++ phpdoc-it/reference/filesystem/functions/rename.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'rename' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.7 Maintainer: cortesi Status: working --> <refentry id="function.rename"> <refnamediv> <refname>rename</refname> @@ -11,16 +9,58 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>int</type><methodname>rename</methodname> + <type>bool</type><methodname>rename</methodname> <methodparam><type>string</type><parameter>oldname</parameter></methodparam> <methodparam><type>string</type><parameter>newname</parameter></methodparam> + <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> </methodsynopsis> <para> Tenta di rinominare <parameter>oldname</parameter> in <parameter>newname</parameter>. </para> <para> - Restituisce &true; se ha successo e &false; se fallisce. + &return.success; + </para> + <para> + <example> + <title>Esempio di uso di <function>rename</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +rename("/tmp/tmp_file.txt", "/home/user/login/docs/my_file.txt"); +?> +]]> + </programlisting> + </example> + </para> + <note> + <para> + Nelle versioni di PHP precedenti alla 4.3.3, la funzione <function>rename</function> + non può rinominare file attraverso partizioni nei sistemi *nix. + </para> + </note> + <note> + <simpara> + Dal <literal>PHP 5.0.0</literal> <function>rename</function> può anche essere utilizzata + con <emphasis>qualche</emphasis> wrapper url. Fare riferimento a <xref linkend="wrappers"/> + per avere l'elenco dei wrapper supportati da <function>rename</function>. + </simpara> + </note> + <note> + <simpara> + Il wrapper utilizzato per <parameter>oldname</parameter> <emphasis>DEVE</emphasis> + essere il medesimo utilizzato per <parameter>newname</parameter>. + </simpara> + </note> + <note> + <simpara> + Il parametro <parameter>context</parameter> è stato aggiunto in <literal>PHP 5.0.0</literal>. + </simpara> + </note> + <para> + Vedere anche <function>copy</function>, + <function>unlink</function> e + <function>move_uploaded_file</function>. </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/rewind.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/rewind.xml diff -u phpdoc-it/reference/filesystem/functions/rewind.xml:1.2 phpdoc-it/reference/filesystem/functions/rewind.xml:1.3 --- phpdoc-it/reference/filesystem/functions/rewind.xml:1.2 Wed Apr 17 03:06:41 2002 +++ phpdoc-it/reference/filesystem/functions/rewind.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'rewind' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.7 Maintainer: cortesi Status: working --> <refentry id="function.rewind"> <refnamediv> <refname>rewind</refname> @@ -11,15 +9,15 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>int</type><methodname>rewind</methodname> - <methodparam><type>int</type><parameter>fp</parameter></methodparam> + <type>bool</type><methodname>rewind</methodname> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> </methodsynopsis> <para> - Pone l'indicatore alla posizione del file per fp all'inizio + Pone l'indicatore alla posizione del file per <parameter>handle</parameter> all'inizio del flusso del file. </para> <para> - Se si verifica un errore, returns 0. + &return.success; </para> <para> Il puntatore al file deve essere valido e deve puntare ad un file http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/rmdir.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/rmdir.xml diff -u phpdoc-it/reference/filesystem/functions/rmdir.xml:1.2 phpdoc-it/reference/filesystem/functions/rmdir.xml:1.3 --- phpdoc-it/reference/filesystem/functions/rmdir.xml:1.2 Wed Apr 17 03:06:41 2002 +++ phpdoc-it/reference/filesystem/functions/rmdir.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'rmdir' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: working --> <refentry id="function.rmdir"> <refnamediv> <refname>rmdir</refname> @@ -11,14 +9,28 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>int</type><methodname>rmdir</methodname> + <type>bool</type><methodname>rmdir</methodname> <methodparam><type>string</type><parameter>dirname</parameter></methodparam> + <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> </methodsynopsis> <para> Tenta di cancellare la directory indiata da pathname. La directory deve essere vuota e i permessi concessi devono permetterlo. &return.success; </para> + <note> + <simpara> + Dal <literal>PHP 5.0.0</literal> <function>rmdir</function> può anche essere utilizzata + con <emphasis>qualche</emphasis> wrapper url. Fare riferimento a <xref linkend="wrappers"/> + per avere l'elenco dei wrapper supportati da <function>rmdir</function>. + </simpara> + </note> + <note> + <simpara> + Il parametro <parameter>context</parameter> è stato aggiunto in <literal>PHP 5.0.0</literal>. + </simpara> + </note> + ¬e.sm.uidcheck.dir; <para> Vedere anche <function>mkdir</function> e <function>unlink</function>. </para> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/set-file-buffer.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/set-file-buffer.xml diff -u phpdoc-it/reference/filesystem/functions/set-file-buffer.xml:1.2 phpdoc-it/reference/filesystem/functions/set-file-buffer.xml:1.3 --- phpdoc-it/reference/filesystem/functions/set-file-buffer.xml:1.2 Wed Apr 17 03:06:41 2002 +++ phpdoc-it/reference/filesystem/functions/set-file-buffer.xml Fri Feb 13 15:47:23 2004 @@ -1,56 +1,15 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'set-file-buffer' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.5 Maintainer: cortesi Status: working --> <refentry id="function.set-file-buffer"> <refnamediv> <refname>set_file_buffer</refname> - <refpurpose>Imposta il buffering del file sul puntatore al file dato</refpurpose> + <refpurpose>Alias di <function>stream_set_write_buffer</function></refpurpose> </refnamediv> <refsect1> <title>Descrizione</title> - <methodsynopsis> - <type>int</type><methodname>set_file_buffer</methodname> - <methodparam><type>int</type><parameter>fp</parameter></methodparam> - <methodparam><type>int</type><parameter>buffer</parameter></methodparam> - </methodsynopsis> <simpara> - L'output di <function>fwrite</function> viene normalmente bufferizzato a - 8K. Ciò significa che se ci sono due processi che vogliono scrivere - nello stesso flusso di output (un file), ciascuno viene interrotto dopo 8K di - dati per permettere all'altro di scrivere. <function>set_file_buffer</function> - imposta il buffering per le operazioni di scrittura sul dato puntatore a file - <parameter>fp</parameter> a <parameter>buffer</parameter> byte. - Se <parameter>buffer</parameter> è 0 allora le operazioni di scrittura non vengono - bufferizzate. Questo assicura che ogni scrittura di - <function>fwrite</function> venga completata prima che sia permesso ad altri processi - di scrivere in quel flusso di output. - </simpara> - <simpara> - La funzione restituisce 0 quando ha successo, o EOF se la richiesta non può - essere soddisfatta. - </simpara> - <para> - L'esempio seguente mostra come usare - <function>set_file_buffer</function> per creare un flusso non bufferizzato. - <example> - <title><function>set_file_buffer</function> example</title> - <programlisting role="php"> -<![CDATA[ -$fp=fopen($file, "w"); -if($fp){ - set_file_buffer($fp, 0); - fputs($fp, $output); - fclose($fp); -} -]]> - </programlisting> - </example> - </para> - - <simpara> - Vedere anche <function>fopen</function>, <function>fwrite</function>. + Questa funzione è un alias di <function>stream_set_write_buffer</function>. </simpara> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/stat.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/stat.xml diff -u phpdoc-it/reference/filesystem/functions/stat.xml:1.2 phpdoc-it/reference/filesystem/functions/stat.xml:1.3 --- phpdoc-it/reference/filesystem/functions/stat.xml:1.2 Wed Apr 17 03:06:42 2002 +++ phpdoc-it/reference/filesystem/functions/stat.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'stat' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.10 Maintainer: cortesi Status: working --> <refentry id="function.stat"> <refnamediv> <refname>stat</refname> @@ -15,39 +13,116 @@ <methodparam><type>string</type><parameter>filename</parameter></methodparam> </methodsynopsis> <para> - Restituisce una serie di informazioni a riguardo del file filename. + Restituisce una serie di informazioni a riguardo del file <parameter>filename</parameter>. + Se il parametro <parameter>filename</parameter> è un link simbolico, le informazioni riguardano il file stesso, + e non il file puntato dal link. La funzione <function>lstat</function> è identica a<function> + stat</function> tranne che dovrebbe restituire il file puntato dal link. </para> <para> - Restituisce un vettore con le statistiche del file con i - seguenti elementi: - <orderedlist> - <listitem><simpara>device</simpara></listitem> - <listitem><simpara>inode</simpara></listitem> - <listitem><simpara>modalità di protezione dell'inode</simpara></listitem> - <listitem><simpara>numero di link</simpara></listitem> - <listitem><simpara>ID utente del proprietario</simpara></listitem> - <listitem><simpara>ID del gruppo del proprietario</simpara></listitem> - <listitem><simpara>tipo di device con l'inode device *</simpara></listitem> - <listitem><simpara>dimensione in byte</simpara></listitem> - <listitem><simpara>ora dell'ultimo aggesso</simpara></listitem> - <listitem><simpara>ora del'ultima modifica</simpara></listitem> - <listitem><simpara>ora dell'ultimo cambiamento</simpara></listitem> - <listitem><simpara>dimensione del blocco per l'I/O di filesystem *</simpara></listitem> - <listitem><simpara>numero dei blocchi allocati</simpara></listitem> - </orderedlist> - * - valida solo su sistemi che supportano il tipo st_blksize--altri sistemi - (ad esempio Windows) restituiscono -1. + In caso di errore <function>stat</function> restituisce &false;. Inoltre + genera un warning. </para> <para> - Restituisce &false; in caso d'errore. + La funzione restituisce un vettore con le informazioni sul file contenente i + seguenti elementi. Il vettore parte dall'indice zero. Oltre agli indici numerici + il vettore contiene indici + associativi, come sarà indicato per ciascun parametro; questo è disponibile + dal PHP versione 4.0.6. </para> <para> - <function>stat</function> cannot be used on <link - linkend="features.remote-files">remote files</link>. + <table> + <title>Formato del vettore restituito da <function>stat</function> + e <function>fstat</function></title> + <tgroup cols="3"> + <thead> + <row> + <entry>Indice numerico</entry> + <entry>Associativo (da PHP 4.0.6)</entry> + <entry>Descrizione</entry> + </row> + </thead> + <tbody> + <row> + <entry>0</entry> + <entry>dev</entry> + <entry>device</entry> + </row> + <row> + <entry>1</entry> + <entry>ino</entry> + <entry>inode</entry> + </row> + <row> + <entry>2</entry> + <entry>mode</entry> + <entry>modalità di protezione dell'inode</entry> + </row> + <row> + <entry>3</entry> + <entry>nlink</entry> + <entry>numero di link</entry> + </row> + <row> + <entry>4</entry> + <entry>uid</entry> + <entry>ID utente del proprietario</entry> + </row> + <row> + <entry>5</entry> + <entry>gid</entry> + <entry>ID del gruppo del proprietario</entry> + </row> + <row> + <entry>6</entry> + <entry>rdev</entry> + <entry>tipo di device con l'inode device *</entry> + </row> + <row> + <entry>7</entry> + <entry>size</entry> + <entry>dimensione in byte</entry> + </row> + <row> + <entry>8</entry> + <entry>atime</entry> + <entry>ora dell'ultimo accesso (Unix timestamp)</entry> + </row> + <row> + <entry>9</entry> + <entry>mtime</entry> + <entry>ora del'ultima modifica (Unix timestamp)</entry> + </row> + <row> + <entry>10</entry> + <entry>ctime</entry> + <entry>ora dell'ultimo cambiamento (Unix timestamp)</entry> + </row> + <row> + <entry>11</entry> + <entry>blksize</entry> + <entry>dimensione del blocco per l'I/O di filesystem *</entry> + </row> + <row> + <entry>12</entry> + <entry>blocks</entry> + <entry>numero dei blocchi allocati</entry> + </row> + + </tbody> + </tgroup> + </table> + * - valida solo su sistemi che supportano il tipo st_blksize--altri sistemi + (ad esempio Windows) restituiscono -1. + + ¬e.clearstatcache; + + &tip.fopen-wrapper.stat; </para> <para> - I risultati di questa funzione vengono memorizzati nella cache. Vedi - <function>clearstatcache</function> per maggiori informazioni. + Vedere anche <function>lstat</function>, + <function>fstat</function>, + <function>filemtime</function> e + <function>filegroup</function>. </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/symlink.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/symlink.xml diff -u phpdoc-it/reference/filesystem/functions/symlink.xml:1.2 phpdoc-it/reference/filesystem/functions/symlink.xml:1.3 --- phpdoc-it/reference/filesystem/functions/symlink.xml:1.2 Wed Apr 17 03:06:42 2002 +++ phpdoc-it/reference/filesystem/functions/symlink.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'symlink' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: working --> <refentry id="function.symlink"> <refnamediv> <refname>symlink</refname> @@ -11,7 +9,7 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>int</type><methodname>symlink</methodname> + <type>bool</type><methodname>symlink</methodname> <methodparam><type>string</type><parameter>target</parameter></methodparam> <methodparam><type>string</type><parameter>link</parameter></methodparam> </methodsynopsis> @@ -21,11 +19,13 @@ il nome specificato da <parameter>link</parameter>. </para> <para> + &return.success; + </para> + <para> Vedere anche <function>link</function> per creare hard link, e <function>readlink</function> con <function>linkinfo</function>. </para> - ¬e.no-windows; </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/tempnam.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/tempnam.xml diff -u phpdoc-it/reference/filesystem/functions/tempnam.xml:1.2 phpdoc-it/reference/filesystem/functions/tempnam.xml:1.3 --- phpdoc-it/reference/filesystem/functions/tempnam.xml:1.2 Wed Apr 17 03:06:42 2002 +++ phpdoc-it/reference/filesystem/functions/tempnam.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'tempnam' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: working --> <refentry id="function.tempnam"> <refnamediv> <refname>tempnam</refname> @@ -31,21 +29,29 @@ Consulta la documentazione del tuo sistema sulla funzione tempnam(3) se non sei sicuro. </para> + <note> + <simpara> + Se il PHP non è in grado di creare il file nella directory <parameter>dir</parameter> + la funzione passa alla directory di default del sistema. + </simpara> + </note> <para> Restituisce il nuovo filename temporaneo, o la stringa &null; se fallisce. <example> <title><function>tempnam</function> example</title> <programlisting role="php"> <![CDATA[ -$tmpfname = tempnam ("/tmp", "FOO"); +<?php +$tmpfname = tempnam("/tmp", "FOO"); -$fp = fopen($tmpfname, "w"); -fwrite($fp, "writing to tempfile"); -fclose($fp); +$handle = fopen($tmpfname, "w"); +fwrite($handle, "writing to tempfile"); + fclose($handle); // do here something unlink($tmpfname); +?> ]]> </programlisting> </example> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/tmpfile.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/tmpfile.xml diff -u phpdoc-it/reference/filesystem/functions/tmpfile.xml:1.2 phpdoc-it/reference/filesystem/functions/tmpfile.xml:1.3 --- phpdoc-it/reference/filesystem/functions/tmpfile.xml:1.2 Wed Apr 17 03:06:42 2002 +++ phpdoc-it/reference/filesystem/functions/tmpfile.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'tmpfile' in en/ tree in rev 1.32 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.32 --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: working --> <refentry id="function.tmpfile"> <refnamediv> <refname>tmpfile</refname> @@ -11,7 +9,7 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>int</type><methodname>tmpfile</methodname> + <type>resource</type><methodname>tmpfile</methodname> <void/> </methodsynopsis> <para> @@ -31,9 +29,11 @@ <title><function>tmpfile</function> example</title> <programlisting role="php"> <![CDATA[ + <?php $temp = tmpfile(); fwrite($temp, "writing to tempfile"); fclose($temp); // this removes the file +?> ]]> </programlisting> </example> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/touch.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/touch.xml diff -u phpdoc-it/reference/filesystem/functions/touch.xml:1.2 phpdoc-it/reference/filesystem/functions/touch.xml:1.3 --- phpdoc-it/reference/filesystem/functions/touch.xml:1.2 Wed Apr 17 03:06:42 2002 +++ phpdoc-it/reference/filesystem/functions/touch.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'touch' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.8 Maintainer: cortesi Status: working --> <refentry id="function.touch"> <refnamediv> <refname>touch</refname> @@ -11,31 +9,37 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>int</type><methodname>touch</methodname> + <type>bool</type><methodname>touch</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>time</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>atime</parameter></methodparam> </methodsynopsis> <para> Tenta di impostare l'ora di modifica del file indicato da filename al valore dato da time. Se non viene passata l'opzione <parameter>time</parameter> - usa l'ora attuale. This is equivalent to what utime - (sometimes referred to as utimes) does. + usa l'ora attuale. Questo equivale a quello che fa utime + (a volte indicato come utimes). Se è presente il terzo parametro opzionale + <parameter>atime</parameter> è presente, viene utilizzato per impostare + l'orario di accesso al file indicato. + Occorre rilevare che l'orario di accesso è sempre modificato, indipendentemente dal + numero dei parametri. </para> <para> Se il file non esiste, viene creato. </para> <para> - Restituisce &true; se ha successo; &false; altrimenti. <example> <title><function>touch</function> example</title> <programlisting role="php"> <![CDATA[ -if (touch ($FileName)) { - print "$FileName modification time has been +<?php +if (touch($FileName)) { + echo "$FileName modification time has been changed to todays date and time"; } else { - print "Sorry Could Not change modification time of $FileName"; + echo "Sorry Could Not change modification time of $FileName"; } +?> ]]> </programlisting> </example> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/umask.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/umask.xml diff -u phpdoc-it/reference/filesystem/functions/umask.xml:1.2 phpdoc-it/reference/filesystem/functions/umask.xml:1.3 --- phpdoc-it/reference/filesystem/functions/umask.xml:1.2 Wed Apr 17 03:06:42 2002 +++ phpdoc-it/reference/filesystem/functions/umask.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'umask' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.5 Maintainer: cortesi Status: working --> <refentry id="function.umask"> <refnamediv> <refname>umask</refname> @@ -12,7 +10,7 @@ <title>Descrizione</title> <methodsynopsis> <type>int</type><methodname>umask</methodname> - <methodparam><type>int</type><parameter>mask</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>mask</parameter></methodparam> </methodsynopsis> <para> <function>umask</function> imposta l'umask di PHP a & 0777 e @@ -23,7 +21,6 @@ <function>umask</function> senza argomenti restituisce semplicemente l'umask corrente. </para> - ¬e.no-windows; </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/unlink.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/unlink.xml diff -u phpdoc-it/reference/filesystem/functions/unlink.xml:1.2 phpdoc-it/reference/filesystem/functions/unlink.xml:1.3 --- phpdoc-it/reference/filesystem/functions/unlink.xml:1.2 Wed Apr 17 03:06:42 2002 +++ phpdoc-it/reference/filesystem/functions/unlink.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'unlink' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: working --> <refentry id="function.unlink"> <refnamediv> <refname>unlink</refname> @@ -11,13 +9,26 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>int</type><methodname>unlink</methodname> + <type>bool</type><methodname>unlink</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> + <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> </methodsynopsis> <para> Cancella <parameter>filename</parameter>. Simile alla funzione C di Unix - unlink(). + unlink(). &return.success; </para> + <note> + <simpara> + Dal <literal>PHP 5.0.0</literal> <function>unlink</function> potrà essere utilizzata anche + con <emphasis>qualche</emphasis> wrapper url. Fare riferimento a <xref linkend="wrappers"/> + per avere la lista di quali wrapper supportano <function>unlink</function>. + </simpara> + </note> + <note> + <simpara> + Il parametro <parameter>context</parameter> è stato aggiunto in <literal>PHP 5.0.0</literal>. + </simpara> + </note> <para> Restituisce 0 o &false; in caso d'errore. </para>
http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/chmod.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-it/reference/filesystem/functions/chmod.xml diff -u phpdoc-it/reference/filesystem/functions/chmod.xml:1.4 phpdoc-it/reference/filesystem/functions/chmod.xml:1.5 --- phpdoc-it/reference/filesystem/functions/chmod.xml:1.4 Fri Oct 10 15:48:59 2003 +++ phpdoc-it/reference/filesystem/functions/chmod.xml Fri Feb 13 15:47:23 2004 @@ -41,7 +41,7 @@ <para> Il parametro <parameter>mode</parameter> consiste in tre numeri ottali costituenti le restrizioni dell'accesso per il proprietario, - il gruppo utente a cui appartiene il proprietrio, e gli altri. + il gruppo utente a cui appartiene il proprietario, e gli altri. Ciascun numero può essere calcolato aggiungendo i permessi al valore base per l'utente. Il numero 1 indica che si abilita all'esecuzione del file, con il numero 2 si assegnano i diritti di scrittura, con il numero 4 @@ -54,16 +54,16 @@ <programlisting role="php"> <![CDATA[ <?php -// Lettura e scrittura per il proprietatio, e nessun permesso per gli altri +// Lettura e scrittura per il proprietario, e nessun permesso per gli altri chmod ("/somedir/somefile", 0600); -// Lettura e scrittura per il proprietatio, e lettura per gli altri +// Lettura e scrittura per il proprietario, e lettura per gli altri chmod ("/somedir/somefile", 0644); -// Accesso completo per il proprietatio, e lettura ed esecuzione per gli altri +// Accesso completo per il proprietario, e lettura ed esecuzione per gli altri chmod ("/somedir/somefile", 0755); -// Accesso completo per il proprietatio, e lettura ed esecuzione per il gruppo del proprietario +// Accesso completo per il proprietario, e lettura ed esecuzione per il gruppo del proprietario chmod ("/somedir/somefile", 0750); ?> ]]> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/clearstatcache.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-it/reference/filesystem/functions/clearstatcache.xml diff -u phpdoc-it/reference/filesystem/functions/clearstatcache.xml:1.3 phpdoc-it/reference/filesystem/functions/clearstatcache.xml:1.4 --- phpdoc-it/reference/filesystem/functions/clearstatcache.xml:1.3 Fri Oct 10 15:48:59 2003 +++ phpdoc-it/reference/filesystem/functions/clearstatcache.xml Fri Feb 13 15:47:23 2004 @@ -15,7 +15,7 @@ Quando si eseguono le funzioni di sistema <systemitem>stat</systemitem> o <systemitem>lstat</systemitem> o una delle funzioni elencate nella lista delle funzioni coinvolte (vedi sotto), il PHP memorizza le informazioni restituite - da queste funzioni in modo da fornire mgliori performance. Esistono, tuttavia, + da queste funzioni in modo da fornire migliori performance. Esistono, tuttavia, casi in cui si desidera rimuovere le informazioni memorizzate. Ad esempio, nel caso in cui un file venga controllato più volte nel medesimo script ed il file si trova in situazioni in cui possa venire rimosso o possa essere variato durante l'esecuzione dello script; in questi casi http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/fread.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/fread.xml diff -u phpdoc-it/reference/filesystem/functions/fread.xml:1.2 phpdoc-it/reference/filesystem/functions/fread.xml:1.3 --- phpdoc-it/reference/filesystem/functions/fread.xml:1.2 Wed Apr 17 03:06:38 2002 +++ phpdoc-it/reference/filesystem/functions/fread.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'fread' in en/ tree in rev 1.25 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.25 --> +<!-- EN-Revision: 1.15 Maintainer: cortesi Status: working --> <refentry id="function.fread"> <refnamediv> <refname>fread</refname> @@ -12,48 +9,99 @@ <title>Descrizione</title> <methodsynopsis> <type>string</type><methodname>fread</methodname> - <methodparam><type>int</type><parameter>fp</parameter></methodparam> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> <methodparam><type>int</type><parameter>length</parameter></methodparam> </methodsynopsis> <simpara> <function>fread</function> legge fino a <parameter>length</parameter> byte dal puntatore al file - indicato da <parameter>fp</parameter>. La lettura finisce quando sono stati letti - <parameter>length</parameter> byte o è stata raggiunta EOF, - qualora giunga prima. + indicato da <parameter>handle</parameter>. La lettura finisce quando sono stati letti + <parameter>length</parameter> byte o è stata raggiunta EOF, o (nel caso di flussi + via rete) quando un pacchetto divnta disponibile, + in base a quale evento accada prima. </simpara> <para> <informalexample> <programlisting role="php"> <![CDATA[ +<?php // copia il contenuto di un file in una stringa $filename = "/usr/local/something.txt"; -$fd = fopen ($filename, "r"); -$contents = fread ($fd, filesize ($filename)); -fclose ($fd); +$handle = fopen($filename, "r"); +$contents = fread($handle, filesize($filename)); +fclose($handle); +?> ]]> </programlisting> </informalexample> </para> - <note> + <warning> <para> Sui sistemi che differenziano fra file di testo e binari (ad esempio Windows) il file deve essere aperto con il parametro mode di <function>fopen</function> impostato a 'b'. </para> - </note> + </warning> <para> <informalexample> <programlisting role="php"> <![CDATA[ +<?php $filename = "c:\\files\\somepic.gif"; -$fd = fopen ($filename, "rb"); -$contents = fread ($fd, filesize ($filename)); -fclose ($fd); +$handle = fopen($filename, "rb"); +$contents = fread($handle, filesize($filename)); +fclose($handle); +?> +]]> + </programlisting> + </informalexample> + </para> + + <warning> + <para> + Quando si ricevono dati via rete o pipe, tipo quelli ottenuti leggendo da + <link linkend="features.remote-files">file remoti</link> o da + <function>popen</function> e <function>proc_open</function>, la lettura + si fermerà dopo avere ricevuto il pacchetto disponibile. + Questo significa che i dati sono ricevuti a blocchi + che devono essere raggruppati, come illustrato nell'esempio seguente. + </para> + </warning> + <para> + <informalexample> + <programlisting role="php"> +<![CDATA[ +<?php +$handle = fopen("http://www.example.com/", "rb"); +$contents = ""; +do { + $data = fread($handle, 8192); + if (strlen($data) == 0) { + break; + } + $contents .= $data; +} while (true); +fclose($handle); +?> ]]> + </programlisting> </informalexample> </para> + <note> + <para> + L'esempio precedente ottiene migliori performance rispetto al tradizionale approccio + tramite while(!<function>feof</function>), poichè si risparmia l'overhead + della chiamata per la funzione di iterazione. + </para> + </note> + <note> + <para> + Se si desidera ottenere il contenuto del file in una stringa, utilizzare + la funzione <function>file_get_contents</function> la quale è ancora più + performante del codice precedente. + </para> + </note> <simpara> Vedere anche <function>fwrite</function>, <function>fopen</function>, <function>fsockopen</function>, <function>popen</function>, http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/fseek.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/fseek.xml diff -u phpdoc-it/reference/filesystem/functions/fseek.xml:1.2 phpdoc-it/reference/filesystem/functions/fseek.xml:1.3 --- phpdoc-it/reference/filesystem/functions/fseek.xml:1.2 Wed Apr 17 03:06:38 2002 +++ phpdoc-it/reference/filesystem/functions/fseek.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'fseek' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.7 Maintainer: cortesi Status: working --> <refentry id="function.fseek"> <refnamediv> <refname>fseek</refname> @@ -12,33 +10,55 @@ <title>Descrizione</title> <methodsynopsis> <type>int</type><methodname>fseek</methodname> - <methodparam><type>int</type><parameter>fp</parameter></methodparam> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> <methodparam><type>int</type><parameter>offset</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>whence</parameter></methodparam> </methodsynopsis> <para> Imposta l'indicatore di posizione del file riferito da - <parameter>fp</parameter>. La nuova posizione, misurata in byte + <parameter>handle</parameter>. La nuova posizione, misurata in byte dall'inizio del file, viene ottenuta aggiungento <parameter>offset</parameter> alla posizione specificata da <parameter>whence</parameter>, i cui valori sono definiti come segue: <simplelist> - <member>SEEK_SET - Imposta la posizione uguale a <parameter>offset</parameter> byte.</member> - <member>SEEK_CUR - Imposta la posizione alla attuale più <parameter>offset</parameter>.</member> - <member>SEEK_END - Imposta la posizione alla fine del file più <parameter>offset</parameter>. + <member><constant>SEEK_SET</constant> - Imposta la posizione uguale a <parameter>offset</parameter> byte.</member> + <member><constant>SEEK_CUR</constant> - Imposta la posizione alla attuale più <parameter>offset</parameter>.</member> + <member><constant>SEEK_END</constant> - Imposta la posizione alla fine del file più <parameter>offset</parameter>. (To move to a position before the end-of-file, you need to pass a negative value in <parameter>offset</parameter>.)</member> </simplelist> </para> - <para>Se <parameter>whence</parameter> non viene specificato, viene assunto come - SEEK_SET. + <para> + Se <parameter>whence</parameter> non viene specificato, viene assunto come + <constant>SEEK_SET</constant>. </para> <para> In caso di successo, restituisce 0; altrimenti, restituisce -1. Nota che spostarsi oltre EOF non è considerato un errore. </para> <para> + <example> + <title>Esempio di uso di <function>fseek</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +$fp = fopen('somefile.txt'); + +// Lettura di qualche dato +$data = fgets($fp, 4096); + +// si torna ad inizio file +// come rewind($fp); +fseek($fp, 0); + +?> +]]> + </programlisting> + </example> + </para> + <para> Non può essere usato su puntatori a file restituiti da <function>fopen</function> se è in uso il formato "http://" o "ftp://". http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/fstat.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/fstat.xml diff -u phpdoc-it/reference/filesystem/functions/fstat.xml:1.2 phpdoc-it/reference/filesystem/functions/fstat.xml:1.3 --- phpdoc-it/reference/filesystem/functions/fstat.xml:1.2 Wed Apr 17 03:06:38 2002 +++ phpdoc-it/reference/filesystem/functions/fstat.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'fstat' in en/ tree in rev 1.24 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.24 --> +<!-- EN-Revision: 1.8 Maintainer: cortesi Status: working --> <refentry id="function.fstat"> <refnamediv> <refname>fstat</refname> @@ -12,38 +10,70 @@ <title>Descrizione</title> <methodsynopsis> <type>array</type><methodname>fstat</methodname> - <methodparam><type>int</type><parameter>fp</parameter></methodparam> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> </methodsynopsis> <para> - Restituisce le statistiche del file aperto dal puntatore fp. + Restituisce le statistiche del file aperto dal puntatore <parameter>handle</parameter>. Questa funzione è simile a <function>stat</function> eccetto per il fatto che opera su un puntatore a file aperto invece che su un nome di file. </para> <para> - Restituisce un vettore con le statistiche del file con i - seguenti elementi: - <orderedlist> - <listitem><simpara>device</simpara></listitem> - <listitem><simpara>inode</simpara></listitem> - <listitem><simpara>numero di link</simpara></listitem> - <listitem><simpara>user id del proprietario</simpara></listitem> - <listitem><simpara>group id del proprietario</simpara></listitem> - <listitem><simpara>tipo di device se è presente l'inode device *</simpara></listitem> - <listitem><simpara>dimensione in byte</simpara></listitem> - <listitem><simpara>ora dell'ultimo accesso</simpara></listitem> - <listitem><simpara>ora dell'ultima modifica</simpara></listitem> - <listitem><simpara>ora del ultimo cambiamento</simpara></listitem> - <listitem><simpara>blocksize per l'I/O del filesystem *</simpara></listitem> - <listitem><simpara>numero di blocchi allocati</simpara></listitem> - </orderedlist> - * - valido solo su sistemi che supportano il tipo st_blksize --negli altri sistemi - (per esempio Windows) restituisce -1 - </para> + Restituisce un vettore con le statistiche del file con il formato + del vettore è descritto nella pagina di <function>stat</function>. + </para> <para> - I risultati di questa funzione vengono memorizzati nella cache. Vedi - <function>clearstatcache</function> per maggiori informazioni. + <example> + <title>Esempio di uso di <function>fstat</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +// apertura del file +$fp = fopen("/etc/passwd", "r"); + +// raccolta delle informazioni +$fstat = fstat($fp); + +// chiusura del file +fclose($fp); + +// scrittura della sola parte associativa +print_r(array_slice($fstat, 13)); + +?> +]]> + </programlisting> + <para> + l'esempio visualizzerà : + </para> + <screen> +<![CDATA[ +Array +( + [dev] => 771 + [ino] => 488704 + [mode] => 33188 + [nlink] => 1 + [uid] => 0 + [gid] => 0 + [rdev] => 0 + [size] => 1114 + [atime] => 1061067181 + [mtime] => 1056136526 + [ctime] => 1056136526 + [blksize] => 4096 + [blocks] => 8 +) +]]> + </screen> + </example> </para> + + ¬e.clearstatcache; + + ¬e.no-remote; + </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/fwrite.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/fwrite.xml diff -u phpdoc-it/reference/filesystem/functions/fwrite.xml:1.2 phpdoc-it/reference/filesystem/functions/fwrite.xml:1.3 --- phpdoc-it/reference/filesystem/functions/fwrite.xml:1.2 Wed Apr 17 03:06:39 2002 +++ phpdoc-it/reference/filesystem/functions/fwrite.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'fwrite' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.8 Maintainer: cortesi Status: working --> <refentry id="function.fwrite"> <refnamediv> <refname>fwrite</refname> @@ -12,14 +10,14 @@ <title>Descrizione</title> <methodsynopsis> <type>int</type><methodname>fwrite</methodname> - <methodparam><type>int</type><parameter>fp</parameter></methodparam> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> <methodparam><type>string</type><parameter>string</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>length</parameter></methodparam> </methodsynopsis> <simpara> <function>fwrite</function> scrive il contenuto di <parameter>string</parameter> nel flusso del file puntato da - <parameter>fp</parameter>. Se l'argomento <parameter>length</parameter> + <parameter>handle</parameter>. Se l'argomento <parameter>length</parameter> è specificato la scrittura si arresterà dopo aver scritto <parameter>length</parameter> byte o alla fine di <parameter>string</parameter> se si verificasse @@ -27,7 +25,7 @@ </simpara> <simpara> <function>fwrite</function> returns the number of bytes - written, or -1 on error. + written, or &false; on error. </simpara> <simpara> Nota che se il parametro <parameter>length</parameter> viene specificato, @@ -43,6 +41,44 @@ <function>fopen</function>. </para> </note> + <para> + <example> + <title>Un semplice esempio di fwrite</title> + <programlisting role="php"> +<![CDATA[ +<?php +$filename = 'test.txt'; +$somecontent = "Aggiunge questa riga al file\n"; + +// Verifica che il file esista e sia riscrivibile +if (is_writable($filename)) { + + // In questo esempio apriamo $filename in append mode. + // Il puntatore del file è posizionato in fondo al file + // è qui che verrà posizionato $somecontent quando eseguiremo fwrite(). + if (!$handle = fopen($filename, 'a')) { + echo "Non si riesce ad aprire il file ($filename)"; + exit; + } + + // Scrive $somecontent nel file aperto. + if (!fwrite($handle, $somecontent)) { + echo "Non si riesce a scrivere nel file ($filename)"; + exit; + } + + echo "Riuscito, scritto ($somecontent) nel file ($filename)"; + + fclose($handle); + +} else { + echo "Il file $filename non è accessibile"; +} +?> +]]> + </programlisting> + </example> + </para> <simpara> Vedere anche <function>fread</function>, <function>fopen</function>, <function>fsockopen</function>, <function>popen</function> e http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/lstat.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/lstat.xml diff -u phpdoc-it/reference/filesystem/functions/lstat.xml:1.2 phpdoc-it/reference/filesystem/functions/lstat.xml:1.3 --- phpdoc-it/reference/filesystem/functions/lstat.xml:1.2 Wed Apr 17 03:06:40 2002 +++ phpdoc-it/reference/filesystem/functions/lstat.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'lstat' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: working --> <refentry id="function.lstat"> <refnamediv> <refname>lstat</refname> @@ -16,41 +14,19 @@ </methodsynopsis> <para> Raccoglie le statistiche del file o del link simbolico chiamato - filename. Questa funzione è identica alla funzione + <parameter>filename</parameter>.. Questa funzione è identica alla funzione <function>stat</function> eccetto che se il paramametro <parameter>filename</parameter> è un link simbolico valido, viene restituito lo stato del link simbolico, non lo stato del file puntato dal link simbolico. </para> - <para> - Restituisce un vettore con le statistiche del file con i - seguenti elementi: - <orderedlist> - <listitem><simpara>device</simpara></listitem> - <listitem><simpara>inode</simpara></listitem> - <listitem><simpara>modalità di protezione dell'inode</simpara></listitem> - <listitem><simpara>numero di link</simpara></listitem> - <listitem><simpara>ID utente del proprietario</simpara></listitem> - <listitem><simpara>ID del gruppo del proprietario</simpara></listitem> - <listitem><simpara>tipo di device con l'inode device *</simpara></listitem> - <listitem><simpara>dimensione in byte</simpara></listitem> - <listitem><simpara>ora dell'ultimo aggesso</simpara></listitem> - <listitem><simpara>ora del'ultima modifica</simpara></listitem> - <listitem><simpara>ora dell'ultimo cambiamento</simpara></listitem> - <listitem><simpara>dimensione del blocco per l'I/O di filesystem *</simpara></listitem> - <listitem><simpara>numero dei blocchi allocati</simpara></listitem> - </orderedlist> - * - valida solo su sistemi che supportano il tipo st_blksize--altri sistemi - (ad esempio Windows) restituiscono -1. - </para> - <para> - <function>lstat</function> cannot be used on <link - linkend="features.remote-files">remote files</link>. - </para> - <para> - I risultati di questa funzione vengono memorizzati nella cache. Vedi - <function>clearstatcache</function> per maggiori informazioni. - </para> + ¬e.clearstatcache; + + &tip.fopen-wrapper.stat; + + <simpara> + Vedere anche <function>stat</function>. + </simpara> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/mkdir.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/mkdir.xml diff -u phpdoc-it/reference/filesystem/functions/mkdir.xml:1.2 phpdoc-it/reference/filesystem/functions/mkdir.xml:1.3 --- phpdoc-it/reference/filesystem/functions/mkdir.xml:1.2 Wed Apr 17 03:06:40 2002 +++ phpdoc-it/reference/filesystem/functions/mkdir.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'mkdir' in en/ tree in rev 1.39 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.39 --> +<!-- EN-Revision: 1.12 Maintainer: cortesi Status: working --> <refentry id="function.mkdir"> <refnamediv> <refname>mkdir</refname> @@ -13,7 +11,8 @@ <methodsynopsis> <type>int</type><methodname>mkdir</methodname> <methodparam><type>string</type><parameter>pathname</parameter></methodparam> - <methodparam><type>int</type><parameter>mode</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>mode</parameter></methodparam> + <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> </methodsynopsis> <para> Tenta di creare la directory specificata da pathname. @@ -23,17 +22,44 @@ iniziare con uno zero. La modalità è anche modificata dall'umask corrente, che puoi cambiare con <function>umask</function>. + </para> + <para> + <note> + <para> + Il parametro mode è ignorato sui sistemi Windows, ed è opzionale dal PHP 4.2.0. + </para> + </note> + </para> + <para> + Il parametro mode viene impostato a 0777 per default; ciò significa dare i maggiori + accessi possibili. Per maggiori dettagli sui valori di mode, leggere le pagine + relative a <function>chmod</function>. <informalexample> <programlisting role="php"> <![CDATA[ -mkdir ("/path/to/my/dir", 0700); +<?php +mkdir("/path/to/my/dir", 0700); +?> ]]> </programlisting> </informalexample> </para> <para> - Restituisce &true; se ha successo e &false; se fallisce. + &return.success; </para> + <note> + <simpara> + A partire da <literal>PHP 5.0.0</literal> la funzione <function>mkdir</function> può anche essere + utilizzata con <emphasis>alcuni</emphasis> wrapper url. Fare riferimento a <xref linkend="wrappers"/> + per avere l'elenco dei wrapper supportati da <function>mkdir</function>. + </simpara> + </note> + <note> + <simpara> + Il parametro <parameter>context</parameter> è stato aggiunto in <literal>PHP 5.0.0</literal>. + </simpara> + </note> + ¬e.sm.uidcheck.dir; <para> Vedere anche <function>rmdir</function>. </para> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/parse-ini-file.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/parse-ini-file.xml diff -u phpdoc-it/reference/filesystem/functions/parse-ini-file.xml:1.2 phpdoc-it/reference/filesystem/functions/parse-ini-file.xml:1.3 --- phpdoc-it/reference/filesystem/functions/parse-ini-file.xml:1.2 Wed Apr 17 03:06:40 2002 +++ phpdoc-it/reference/filesystem/functions/parse-ini-file.xml Fri Feb 13 15:47:23 2004 @@ -1,89 +1,116 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'parse-ini-file' in en/ tree in rev 1.87 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.87 --> +<!-- EN-Revision: 1.16 Maintainer: darvina Status: ready --> +<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.87 --> <refentry id="function.parse-ini-file"> <refnamediv> <refname>parse_ini_file</refname> - <refpurpose>Parse a configuration file</refpurpose> + <refpurpose>Legge il file di configurazione</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrizione</title> <methodsynopsis> <type>array</type><methodname>parse_ini_file</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>process_sections</parameter></methodparam> </methodsynopsis> <para> - <function>parse_ini_file</function> loads in the - ini file specified in <parameter>filename</parameter>, - and returns the settings in it in an associative array. - By setting the last <parameter>process_sections</parameter> - parameter to &true;, you get a multidimensional array, with - the section names and settings included. The default - for <parameter>process_sections</parameter> is &false; + La funzione <function>parse_ini_file</function> carica il file ini + specificato da <parameter>filename</parameter>, + e restituisce le impostazioni in un array associativo. + Impostando <parameter>process_sections</parameter> a &true; + si ottiene una matrice multi-dimensionale con in nomi + delle sezioni e le impostazioni ivi incluse. Per default + <parameter>process_sections</parameter> è impostato a falso &false; </para> <note> <para> - This function has nothing to do with the - <filename>php.ini</filename> file. It is already processed, - the time you run your script. This function can be used to - read in your own application's configuration files. + Questa funzione non è collegata con il file + &php.ini;. Questo è già elaborato + al momento in cui gira lo script. Questa funzione può essere utilizzata + per leggere i file ini propri dell'applicazione. </para> </note> + <note> + <para> + Se in un valore il file ini contiene caratteri non alfanumerici + questi debbono essere delitimitati dai doppi apici ("). + </para> + </note> + <note> + <simpara> + Dalla versione 4.2.1 di PHP questa funzione è limitata da by &safemode; + e da <link linkend="ini.open-basedir">open_basedir</link>. + </simpara> + </note> + <note> + <simpara> + Esistono parole riservate che non possono essere utilizzare come chiavi + nei file ini. Queste includono: null, yes, no, true, and false. + + </simpara> + </note> <para> - The structure of the ini file is similar to that of - the <filename>php.ini</filename>'s. + La struttura del file ini è simile a quella del + &php.ini;. + </para> + <para> + Le <link linkend="language.constants">Costanti</link> possono essere definite + in un file ini, quindi se si definisce la costante come un valore da file ini + prima di eseguire <function>parse_ini_file</function>, la funzione integrerà nella costante + il valore letto. Saranno considerati solo i valori ini. Ad esempio: </para> <para> <example> - <title>Contents of sample.ini</title> + <title>Contenuto di <filename>sample.ini</filename></title> <programlisting> <![CDATA[ -; This is a sample configuration file -; Comments start with ';', as in php.ini +; Questo è un esempio di file di configurazione +; I commenti cominciano con ';', come in php.ini [first_section] one = 1 five = 5 +animal = BIRD [second_section] path = /usr/local/bin +URL = "http://www.example.com/~username" ]]> </programlisting> </example> </para> <para> <example> - <title><function>parse_ini_file</function> example</title> - <programlisting> + <title>Esempio di uso di <function>parse_ini_file</function></title> + <programlisting role="php"> <![CDATA[ <?php -// Parse without sections +define('BIRD', 'Dodo bird'); + +// Lettura senza sezioni $ini_array = parse_ini_file("sample.ini"); print_r($ini_array); -// Parse with sections -$ini_array = parse_ini_file("sample.ini", TRUE); +// Lettura con sezioni +$ini_array = parse_ini_file("sample.ini", true); print_r($ini_array); ?> ]]> </programlisting> - </example> - </para> - <para> - Would produce: - <informalexample> - <programlisting> + <para> + L'esempio produrrà: + </para> + <screen> <![CDATA[ Array ( [one] => 1 [five] => 5 + [animal] => Dodo bird [path] => /usr/local/bin + [URL] => http://www.example.com/~username ) Array ( @@ -91,17 +118,19 @@ ( [one] => 1 [five] => 5 + [animal] = Dodo bird ) [second_section] => Array ( [path] => /usr/local/bin + [URL] => http://www.example.com/~username ) ) ]]> - </programlisting> - </informalexample> + </screen> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/pathinfo.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/pathinfo.xml diff -u phpdoc-it/reference/filesystem/functions/pathinfo.xml:1.2 phpdoc-it/reference/filesystem/functions/pathinfo.xml:1.3 --- phpdoc-it/reference/filesystem/functions/pathinfo.xml:1.2 Wed Apr 17 03:06:40 2002 +++ phpdoc-it/reference/filesystem/functions/pathinfo.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'pathinfo' in en/ tree in rev 1.61 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.61 --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: working --> <refentry id="function.pathinfo"> <refnamediv> <refname>pathinfo</refname> @@ -37,20 +35,25 @@ ?> ]]> </programlisting> - </example> - </para> - <para> - produrra: - <informalexample> - <programlisting> + <para> + produrra: + </para> + <screen> <![CDATA[ /www/htdocs index.html html ]]> - </programlisting> - </informalexample> + </screen> + </example> </para> + <note> + <para> + Per maggiori dettagli sul recupero del percorso corrente, leggere + la sezione <link linkend="language.variables.predefined"> + variabili predefinite riservate</link>. + </para> + </note> <para> Vedere anche <function>dirname</function>, <function>basename</function>, <function>parse_url</function> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/pclose.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/pclose.xml diff -u phpdoc-it/reference/filesystem/functions/pclose.xml:1.2 phpdoc-it/reference/filesystem/functions/pclose.xml:1.3 --- phpdoc-it/reference/filesystem/functions/pclose.xml:1.2 Wed Apr 17 03:06:41 2002 +++ phpdoc-it/reference/filesystem/functions/pclose.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'pclose' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: working --> <refentry id="function.pclose"> <refnamediv> <refname>pclose</refname> @@ -12,7 +10,7 @@ <title>Descrizione</title> <methodsynopsis> <type>int</type><methodname>pclose</methodname> - <methodparam><type>int</type><parameter>fp</parameter></methodparam> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> </methodsynopsis> <para> Chiude un puntatore ad una pipe aperto da http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/popen.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/popen.xml diff -u phpdoc-it/reference/filesystem/functions/popen.xml:1.2 phpdoc-it/reference/filesystem/functions/popen.xml:1.3 --- phpdoc-it/reference/filesystem/functions/popen.xml:1.2 Wed Apr 17 03:06:41 2002 +++ phpdoc-it/reference/filesystem/functions/popen.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'popen' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.11 Maintainer: cortesi Status: working --> <refentry id="function.popen"> <refnamediv> <refname>popen</refname> @@ -11,7 +9,7 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>int</type><methodname>popen</methodname> + <type>resource</type><methodname>popen</methodname> <methodparam><type>string</type><parameter>command</parameter></methodparam> <methodparam><type>string</type><parameter>mode</parameter></methodparam> </methodsynopsis> @@ -30,40 +28,57 @@ <para> Se si verifica un errore, restituisce &false;. </para> + <note> + <para> + Se si sta cercando un supporto bi-direzionale (2 vie), utilizzare + <function>proc_open</function>. + </para> + </note> <para> - <informalexample> + <example> + <title>Esempio di uso di <function>popen</function></title> <programlisting role="php"> <![CDATA[ -$fp = popen ("/bin/ls", "r"); +<?php +$handle = popen("/bin/ls", "r"); +?> ]]> </programlisting> - </informalexample> + </example> </para> - <note> - <para> - If the command to be executed could not be found, a valid - resource is returned. This may seem odd, but makes sense; it - allows you to access any error message returned by the shell: - <informalexample> - <programlisting role="php"> + <para> + Se il comando che deve essere eseguito non è trovato, la funzione + restituisce una risorsa valida. Questo sembra strano, ma ha un senso; + esso permette di accedere ai messaggi di erore restituiti dalla shell: + <informalexample> + <programlisting role="php"> <![CDATA[ <?php error_reporting(E_ALL); -/* Add redirection so we can get stderr. */ -$fp = popen('/path/to/spooge 2>&1', 'r'); -echo "'$fp'; " . gettype($fp) . "\n"; -$read = fread($fp, 2096); +/* Aggiunge una redirezione, così possiamo ottenere stderr. */ +$handle = popen('/path/to/spooge 2>&1', 'r'); +echo "'$handle'; " . gettype($handle) . "\n"; +$read = fread($handle, 2096); echo $read; -pclose($fp); +pclose($handle); ?> ]]> </programlisting> </informalexample> </para> + <note> + <simpara> + Quando è abilitato il <link linkend="features.safe-mode">safe mode</link> + si possono eseguire solo gli eseguibili presenti nella directoy <link + linkend="ini.safe-mode-exec-dir">safe_mode_exec_dir</link>. + Per ragioni pratiche, attualmente, non è consentito avere + <literal>..</literal> nel percorso dell'eseguibile. + </simpara> </note> <para> - Vedere anche <function>pclose</function>. + Vedere anche <function>pclose</function>, <function>fopen</function> + e <function>proc_open</function>. </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/readfile.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/readfile.xml diff -u phpdoc-it/reference/filesystem/functions/readfile.xml:1.2 phpdoc-it/reference/filesystem/functions/readfile.xml:1.3 --- phpdoc-it/reference/filesystem/functions/readfile.xml:1.2 Wed Apr 17 03:06:41 2002 +++ phpdoc-it/reference/filesystem/functions/readfile.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'readfile' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: working --> <refentry id="function.readfile"> <refnamediv> <refname>readfile</refname> @@ -13,7 +11,8 @@ <methodsynopsis> <type>int</type><methodname>readfile</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>use_include_path</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>use_include_path</parameter></methodparam> + <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> </methodsynopsis> <para> Legge un file e lo scrive nello standard output. @@ -21,39 +20,20 @@ <para> Restituisce il numero di byte letti dal file. Se si verifica un errore viene restituito &false; e se la funzione non è stata chiamata come - @readfile, un messaggio d'errore verra stampato. + @<function>readfile</function>, un messaggio d'errore verra stampato. </para> + &tip.fopen-wrapper; <para> - Se <parameter>filename</parameter> inzia con "http://" - (case insensitive), viene aperta una connessione HTTP 1.0 al server - specificato e il testo della risposta viene scritto nello stadard - output. - </para> - <para> - Versioni precedenti al PHP 4.0.5 non considera le redirezioni HTTP. - Perciò, le directory devono includere gli slash finali. - </para> - <para> - Se <parameter>filename</parameter> inizia con "ftp://" - (case insensitive), viene aperta una connessione ftp al server specificato - e il file richiesto viene stampato sullo standard output. Se il server - non supporta l'ftp passivo, questa funzione fallirà. - </para> - <para> - Se <parameter>filename</parameter> non inizia con tali stringhe, - il file verrà apperto dal filesystem e il suo - contenuto verrà scritto nello standard output. - </para> - <para> - Puoi settare il secondo parametro opzionale ad "1", se + Puoi settare il secondo parametro opzionale ad &true;, se vuoi anche cercare il file nella <link linkend="ini.include-path">include_path</link>. </para> <para> Vedere anche <function>fpassthru</function>, <function>file</function>, <function>fopen</function>, - <function>include</function>, <function>require</function> e - <function>virtual</function>. + <function>include</function>, <function>require</function> + <function>virtual</function>, <function>file_get_contents</function> + e <xref linkend="wrappers"/>. </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/readlink.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/readlink.xml diff -u phpdoc-it/reference/filesystem/functions/readlink.xml:1.2 phpdoc-it/reference/filesystem/functions/readlink.xml:1.3 --- phpdoc-it/reference/filesystem/functions/readlink.xml:1.2 Wed Apr 17 03:06:41 2002 +++ phpdoc-it/reference/filesystem/functions/readlink.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'readlink' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: working --> <refentry id="function.readlink"> <refnamediv> <refname>readlink</refname> @@ -20,11 +18,24 @@ in caso d'errore. </para> <para> + <example> + <title>Esempio di uso di <function>readlink</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// ad esempio visualizza /boot/vmlinux-2.4.20-xfs +echo readlink('/vmlinuz'); + +?> +]]> + </programlisting> + </example> + </para> + <para> Vedere anche <function>symlink</function>, <function>readlink</function> e <function>linkinfo</function>. </para> - ¬e.no-windows; </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/realpath.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-it/reference/filesystem/functions/realpath.xml diff -u phpdoc-it/reference/filesystem/functions/realpath.xml:1.3 phpdoc-it/reference/filesystem/functions/realpath.xml:1.4 --- phpdoc-it/reference/filesystem/functions/realpath.xml:1.3 Tue Apr 23 05:40:41 2002 +++ phpdoc-it/reference/filesystem/functions/realpath.xml Fri Feb 13 15:47:23 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: cortesi Status: working --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: working --> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> <refentry id="function.realpath"> <refnamediv> @@ -28,7 +28,9 @@ <title>Esempio di <function>realpath</function></title> <programlisting role="php"> <![CDATA[ -$real_path = realpath ("../../index.php"); +<?php +$real_path = realpath("../../index.php"); +?> ]]> </programlisting> </example> @@ -36,7 +38,7 @@ <para> Vedere anche: <function>basename</function>, <function>dirname</function> e - <function>path_info</function>. + <function>pathinfo</function>. </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/rename.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/rename.xml diff -u phpdoc-it/reference/filesystem/functions/rename.xml:1.2 phpdoc-it/reference/filesystem/functions/rename.xml:1.3 --- phpdoc-it/reference/filesystem/functions/rename.xml:1.2 Wed Apr 17 03:06:41 2002 +++ phpdoc-it/reference/filesystem/functions/rename.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'rename' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.7 Maintainer: cortesi Status: working --> <refentry id="function.rename"> <refnamediv> <refname>rename</refname> @@ -11,16 +9,58 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>int</type><methodname>rename</methodname> + <type>bool</type><methodname>rename</methodname> <methodparam><type>string</type><parameter>oldname</parameter></methodparam> <methodparam><type>string</type><parameter>newname</parameter></methodparam> + <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> </methodsynopsis> <para> Tenta di rinominare <parameter>oldname</parameter> in <parameter>newname</parameter>. </para> <para> - Restituisce &true; se ha successo e &false; se fallisce. + &return.success; + </para> + <para> + <example> + <title>Esempio di uso di <function>rename</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +rename("/tmp/tmp_file.txt", "/home/user/login/docs/my_file.txt"); +?> +]]> + </programlisting> + </example> + </para> + <note> + <para> + Nelle versioni di PHP precedenti alla 4.3.3, la funzione <function>rename</function> + non può rinominare file attraverso partizioni nei sistemi *nix. + </para> + </note> + <note> + <simpara> + Dal <literal>PHP 5.0.0</literal> <function>rename</function> può anche essere utilizzata + con <emphasis>qualche</emphasis> wrapper url. Fare riferimento a <xref linkend="wrappers"/> + per avere l'elenco dei wrapper supportati da <function>rename</function>. + </simpara> + </note> + <note> + <simpara> + Il wrapper utilizzato per <parameter>oldname</parameter> <emphasis>DEVE</emphasis> + essere il medesimo utilizzato per <parameter>newname</parameter>. + </simpara> + </note> + <note> + <simpara> + Il parametro <parameter>context</parameter> è stato aggiunto in <literal>PHP 5.0.0</literal>. + </simpara> + </note> + <para> + Vedere anche <function>copy</function>, + <function>unlink</function> e + <function>move_uploaded_file</function>. </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/rewind.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/rewind.xml diff -u phpdoc-it/reference/filesystem/functions/rewind.xml:1.2 phpdoc-it/reference/filesystem/functions/rewind.xml:1.3 --- phpdoc-it/reference/filesystem/functions/rewind.xml:1.2 Wed Apr 17 03:06:41 2002 +++ phpdoc-it/reference/filesystem/functions/rewind.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'rewind' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.7 Maintainer: cortesi Status: working --> <refentry id="function.rewind"> <refnamediv> <refname>rewind</refname> @@ -11,15 +9,15 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>int</type><methodname>rewind</methodname> - <methodparam><type>int</type><parameter>fp</parameter></methodparam> + <type>bool</type><methodname>rewind</methodname> + <methodparam><type>resource</type><parameter>handle</parameter></methodparam> </methodsynopsis> <para> - Pone l'indicatore alla posizione del file per fp all'inizio + Pone l'indicatore alla posizione del file per <parameter>handle</parameter> all'inizio del flusso del file. </para> <para> - Se si verifica un errore, returns 0. + &return.success; </para> <para> Il puntatore al file deve essere valido e deve puntare ad un file http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/rmdir.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/rmdir.xml diff -u phpdoc-it/reference/filesystem/functions/rmdir.xml:1.2 phpdoc-it/reference/filesystem/functions/rmdir.xml:1.3 --- phpdoc-it/reference/filesystem/functions/rmdir.xml:1.2 Wed Apr 17 03:06:41 2002 +++ phpdoc-it/reference/filesystem/functions/rmdir.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'rmdir' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: working --> <refentry id="function.rmdir"> <refnamediv> <refname>rmdir</refname> @@ -11,14 +9,28 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>int</type><methodname>rmdir</methodname> + <type>bool</type><methodname>rmdir</methodname> <methodparam><type>string</type><parameter>dirname</parameter></methodparam> + <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> </methodsynopsis> <para> Tenta di cancellare la directory indiata da pathname. La directory deve essere vuota e i permessi concessi devono permetterlo. &return.success; </para> + <note> + <simpara> + Dal <literal>PHP 5.0.0</literal> <function>rmdir</function> può anche essere utilizzata + con <emphasis>qualche</emphasis> wrapper url. Fare riferimento a <xref linkend="wrappers"/> + per avere l'elenco dei wrapper supportati da <function>rmdir</function>. + </simpara> + </note> + <note> + <simpara> + Il parametro <parameter>context</parameter> è stato aggiunto in <literal>PHP 5.0.0</literal>. + </simpara> + </note> + ¬e.sm.uidcheck.dir; <para> Vedere anche <function>mkdir</function> e <function>unlink</function>. </para> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/set-file-buffer.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/set-file-buffer.xml diff -u phpdoc-it/reference/filesystem/functions/set-file-buffer.xml:1.2 phpdoc-it/reference/filesystem/functions/set-file-buffer.xml:1.3 --- phpdoc-it/reference/filesystem/functions/set-file-buffer.xml:1.2 Wed Apr 17 03:06:41 2002 +++ phpdoc-it/reference/filesystem/functions/set-file-buffer.xml Fri Feb 13 15:47:23 2004 @@ -1,56 +1,15 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'set-file-buffer' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.5 Maintainer: cortesi Status: working --> <refentry id="function.set-file-buffer"> <refnamediv> <refname>set_file_buffer</refname> - <refpurpose>Imposta il buffering del file sul puntatore al file dato</refpurpose> + <refpurpose>Alias di <function>stream_set_write_buffer</function></refpurpose> </refnamediv> <refsect1> <title>Descrizione</title> - <methodsynopsis> - <type>int</type><methodname>set_file_buffer</methodname> - <methodparam><type>int</type><parameter>fp</parameter></methodparam> - <methodparam><type>int</type><parameter>buffer</parameter></methodparam> - </methodsynopsis> <simpara> - L'output di <function>fwrite</function> viene normalmente bufferizzato a - 8K. Ciò significa che se ci sono due processi che vogliono scrivere - nello stesso flusso di output (un file), ciascuno viene interrotto dopo 8K di - dati per permettere all'altro di scrivere. <function>set_file_buffer</function> - imposta il buffering per le operazioni di scrittura sul dato puntatore a file - <parameter>fp</parameter> a <parameter>buffer</parameter> byte. - Se <parameter>buffer</parameter> è 0 allora le operazioni di scrittura non vengono - bufferizzate. Questo assicura che ogni scrittura di - <function>fwrite</function> venga completata prima che sia permesso ad altri processi - di scrivere in quel flusso di output. - </simpara> - <simpara> - La funzione restituisce 0 quando ha successo, o EOF se la richiesta non può - essere soddisfatta. - </simpara> - <para> - L'esempio seguente mostra come usare - <function>set_file_buffer</function> per creare un flusso non bufferizzato. - <example> - <title><function>set_file_buffer</function> example</title> - <programlisting role="php"> -<![CDATA[ -$fp=fopen($file, "w"); -if($fp){ - set_file_buffer($fp, 0); - fputs($fp, $output); - fclose($fp); -} -]]> - </programlisting> - </example> - </para> - - <simpara> - Vedere anche <function>fopen</function>, <function>fwrite</function>. + Questa funzione è un alias di <function>stream_set_write_buffer</function>. </simpara> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/stat.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/stat.xml diff -u phpdoc-it/reference/filesystem/functions/stat.xml:1.2 phpdoc-it/reference/filesystem/functions/stat.xml:1.3 --- phpdoc-it/reference/filesystem/functions/stat.xml:1.2 Wed Apr 17 03:06:42 2002 +++ phpdoc-it/reference/filesystem/functions/stat.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'stat' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.10 Maintainer: cortesi Status: working --> <refentry id="function.stat"> <refnamediv> <refname>stat</refname> @@ -15,39 +13,116 @@ <methodparam><type>string</type><parameter>filename</parameter></methodparam> </methodsynopsis> <para> - Restituisce una serie di informazioni a riguardo del file filename. + Restituisce una serie di informazioni a riguardo del file <parameter>filename</parameter>. + Se il parametro <parameter>filename</parameter> è un link simbolico, le informazioni riguardano il file stesso, + e non il file puntato dal link. La funzione <function>lstat</function> è identica a<function> + stat</function> tranne che dovrebbe restituire il file puntato dal link. </para> <para> - Restituisce un vettore con le statistiche del file con i - seguenti elementi: - <orderedlist> - <listitem><simpara>device</simpara></listitem> - <listitem><simpara>inode</simpara></listitem> - <listitem><simpara>modalità di protezione dell'inode</simpara></listitem> - <listitem><simpara>numero di link</simpara></listitem> - <listitem><simpara>ID utente del proprietario</simpara></listitem> - <listitem><simpara>ID del gruppo del proprietario</simpara></listitem> - <listitem><simpara>tipo di device con l'inode device *</simpara></listitem> - <listitem><simpara>dimensione in byte</simpara></listitem> - <listitem><simpara>ora dell'ultimo aggesso</simpara></listitem> - <listitem><simpara>ora del'ultima modifica</simpara></listitem> - <listitem><simpara>ora dell'ultimo cambiamento</simpara></listitem> - <listitem><simpara>dimensione del blocco per l'I/O di filesystem *</simpara></listitem> - <listitem><simpara>numero dei blocchi allocati</simpara></listitem> - </orderedlist> - * - valida solo su sistemi che supportano il tipo st_blksize--altri sistemi - (ad esempio Windows) restituiscono -1. + In caso di errore <function>stat</function> restituisce &false;. Inoltre + genera un warning. </para> <para> - Restituisce &false; in caso d'errore. + La funzione restituisce un vettore con le informazioni sul file contenente i + seguenti elementi. Il vettore parte dall'indice zero. Oltre agli indici numerici + il vettore contiene indici + associativi, come sarà indicato per ciascun parametro; questo è disponibile + dal PHP versione 4.0.6. </para> <para> - <function>stat</function> cannot be used on <link - linkend="features.remote-files">remote files</link>. + <table> + <title>Formato del vettore restituito da <function>stat</function> + e <function>fstat</function></title> + <tgroup cols="3"> + <thead> + <row> + <entry>Indice numerico</entry> + <entry>Associativo (da PHP 4.0.6)</entry> + <entry>Descrizione</entry> + </row> + </thead> + <tbody> + <row> + <entry>0</entry> + <entry>dev</entry> + <entry>device</entry> + </row> + <row> + <entry>1</entry> + <entry>ino</entry> + <entry>inode</entry> + </row> + <row> + <entry>2</entry> + <entry>mode</entry> + <entry>modalità di protezione dell'inode</entry> + </row> + <row> + <entry>3</entry> + <entry>nlink</entry> + <entry>numero di link</entry> + </row> + <row> + <entry>4</entry> + <entry>uid</entry> + <entry>ID utente del proprietario</entry> + </row> + <row> + <entry>5</entry> + <entry>gid</entry> + <entry>ID del gruppo del proprietario</entry> + </row> + <row> + <entry>6</entry> + <entry>rdev</entry> + <entry>tipo di device con l'inode device *</entry> + </row> + <row> + <entry>7</entry> + <entry>size</entry> + <entry>dimensione in byte</entry> + </row> + <row> + <entry>8</entry> + <entry>atime</entry> + <entry>ora dell'ultimo accesso (Unix timestamp)</entry> + </row> + <row> + <entry>9</entry> + <entry>mtime</entry> + <entry>ora del'ultima modifica (Unix timestamp)</entry> + </row> + <row> + <entry>10</entry> + <entry>ctime</entry> + <entry>ora dell'ultimo cambiamento (Unix timestamp)</entry> + </row> + <row> + <entry>11</entry> + <entry>blksize</entry> + <entry>dimensione del blocco per l'I/O di filesystem *</entry> + </row> + <row> + <entry>12</entry> + <entry>blocks</entry> + <entry>numero dei blocchi allocati</entry> + </row> + + </tbody> + </tgroup> + </table> + * - valida solo su sistemi che supportano il tipo st_blksize--altri sistemi + (ad esempio Windows) restituiscono -1. + + ¬e.clearstatcache; + + &tip.fopen-wrapper.stat; </para> <para> - I risultati di questa funzione vengono memorizzati nella cache. Vedi - <function>clearstatcache</function> per maggiori informazioni. + Vedere anche <function>lstat</function>, + <function>fstat</function>, + <function>filemtime</function> e + <function>filegroup</function>. </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/symlink.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/symlink.xml diff -u phpdoc-it/reference/filesystem/functions/symlink.xml:1.2 phpdoc-it/reference/filesystem/functions/symlink.xml:1.3 --- phpdoc-it/reference/filesystem/functions/symlink.xml:1.2 Wed Apr 17 03:06:42 2002 +++ phpdoc-it/reference/filesystem/functions/symlink.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'symlink' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: working --> <refentry id="function.symlink"> <refnamediv> <refname>symlink</refname> @@ -11,7 +9,7 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>int</type><methodname>symlink</methodname> + <type>bool</type><methodname>symlink</methodname> <methodparam><type>string</type><parameter>target</parameter></methodparam> <methodparam><type>string</type><parameter>link</parameter></methodparam> </methodsynopsis> @@ -21,11 +19,13 @@ il nome specificato da <parameter>link</parameter>. </para> <para> + &return.success; + </para> + <para> Vedere anche <function>link</function> per creare hard link, e <function>readlink</function> con <function>linkinfo</function>. </para> - ¬e.no-windows; </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/tempnam.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/tempnam.xml diff -u phpdoc-it/reference/filesystem/functions/tempnam.xml:1.2 phpdoc-it/reference/filesystem/functions/tempnam.xml:1.3 --- phpdoc-it/reference/filesystem/functions/tempnam.xml:1.2 Wed Apr 17 03:06:42 2002 +++ phpdoc-it/reference/filesystem/functions/tempnam.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'tempnam' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: working --> <refentry id="function.tempnam"> <refnamediv> <refname>tempnam</refname> @@ -31,21 +29,29 @@ Consulta la documentazione del tuo sistema sulla funzione tempnam(3) se non sei sicuro. </para> + <note> + <simpara> + Se il PHP non è in grado di creare il file nella directory <parameter>dir</parameter> + la funzione passa alla directory di default del sistema. + </simpara> + </note> <para> Restituisce il nuovo filename temporaneo, o la stringa &null; se fallisce. <example> <title><function>tempnam</function> example</title> <programlisting role="php"> <![CDATA[ -$tmpfname = tempnam ("/tmp", "FOO"); +<?php +$tmpfname = tempnam("/tmp", "FOO"); -$fp = fopen($tmpfname, "w"); -fwrite($fp, "writing to tempfile"); -fclose($fp); +$handle = fopen($tmpfname, "w"); +fwrite($handle, "writing to tempfile"); + fclose($handle); // do here something unlink($tmpfname); +?> ]]> </programlisting> </example> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/tmpfile.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/tmpfile.xml diff -u phpdoc-it/reference/filesystem/functions/tmpfile.xml:1.2 phpdoc-it/reference/filesystem/functions/tmpfile.xml:1.3 --- phpdoc-it/reference/filesystem/functions/tmpfile.xml:1.2 Wed Apr 17 03:06:42 2002 +++ phpdoc-it/reference/filesystem/functions/tmpfile.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'tmpfile' in en/ tree in rev 1.32 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.32 --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: working --> <refentry id="function.tmpfile"> <refnamediv> <refname>tmpfile</refname> @@ -11,7 +9,7 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>int</type><methodname>tmpfile</methodname> + <type>resource</type><methodname>tmpfile</methodname> <void/> </methodsynopsis> <para> @@ -31,9 +29,11 @@ <title><function>tmpfile</function> example</title> <programlisting role="php"> <![CDATA[ + <?php $temp = tmpfile(); fwrite($temp, "writing to tempfile"); fclose($temp); // this removes the file +?> ]]> </programlisting> </example> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/touch.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/touch.xml diff -u phpdoc-it/reference/filesystem/functions/touch.xml:1.2 phpdoc-it/reference/filesystem/functions/touch.xml:1.3 --- phpdoc-it/reference/filesystem/functions/touch.xml:1.2 Wed Apr 17 03:06:42 2002 +++ phpdoc-it/reference/filesystem/functions/touch.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'touch' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.8 Maintainer: cortesi Status: working --> <refentry id="function.touch"> <refnamediv> <refname>touch</refname> @@ -11,31 +9,37 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>int</type><methodname>touch</methodname> + <type>bool</type><methodname>touch</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>time</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>atime</parameter></methodparam> </methodsynopsis> <para> Tenta di impostare l'ora di modifica del file indicato da filename al valore dato da time. Se non viene passata l'opzione <parameter>time</parameter> - usa l'ora attuale. This is equivalent to what utime - (sometimes referred to as utimes) does. + usa l'ora attuale. Questo equivale a quello che fa utime + (a volte indicato come utimes). Se è presente il terzo parametro opzionale + <parameter>atime</parameter> è presente, viene utilizzato per impostare + l'orario di accesso al file indicato. + Occorre rilevare che l'orario di accesso è sempre modificato, indipendentemente dal + numero dei parametri. </para> <para> Se il file non esiste, viene creato. </para> <para> - Restituisce &true; se ha successo; &false; altrimenti. <example> <title><function>touch</function> example</title> <programlisting role="php"> <![CDATA[ -if (touch ($FileName)) { - print "$FileName modification time has been +<?php +if (touch($FileName)) { + echo "$FileName modification time has been changed to todays date and time"; } else { - print "Sorry Could Not change modification time of $FileName"; + echo "Sorry Could Not change modification time of $FileName"; } +?> ]]> </programlisting> </example> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/umask.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/umask.xml diff -u phpdoc-it/reference/filesystem/functions/umask.xml:1.2 phpdoc-it/reference/filesystem/functions/umask.xml:1.3 --- phpdoc-it/reference/filesystem/functions/umask.xml:1.2 Wed Apr 17 03:06:42 2002 +++ phpdoc-it/reference/filesystem/functions/umask.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'umask' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.5 Maintainer: cortesi Status: working --> <refentry id="function.umask"> <refnamediv> <refname>umask</refname> @@ -12,7 +10,7 @@ <title>Descrizione</title> <methodsynopsis> <type>int</type><methodname>umask</methodname> - <methodparam><type>int</type><parameter>mask</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>mask</parameter></methodparam> </methodsynopsis> <para> <function>umask</function> imposta l'umask di PHP a & 0777 e @@ -23,7 +21,6 @@ <function>umask</function> senza argomenti restituisce semplicemente l'umask corrente. </para> - ¬e.no-windows; </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-it/reference/filesystem/functions/unlink.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/filesystem/functions/unlink.xml diff -u phpdoc-it/reference/filesystem/functions/unlink.xml:1.2 phpdoc-it/reference/filesystem/functions/unlink.xml:1.3 --- phpdoc-it/reference/filesystem/functions/unlink.xml:1.2 Wed Apr 17 03:06:42 2002 +++ phpdoc-it/reference/filesystem/functions/unlink.xml Fri Feb 13 15:47:23 2004 @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'unlink' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.2 --> +<!-- EN-Revision: 1.6 Maintainer: cortesi Status: working --> <refentry id="function.unlink"> <refnamediv> <refname>unlink</refname> @@ -11,13 +9,26 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>int</type><methodname>unlink</methodname> + <type>bool</type><methodname>unlink</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> + <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> </methodsynopsis> <para> Cancella <parameter>filename</parameter>. Simile alla funzione C di Unix - unlink(). + unlink(). &return.success; </para> + <note> + <simpara> + Dal <literal>PHP 5.0.0</literal> <function>unlink</function> potrà essere utilizzata anche + con <emphasis>qualche</emphasis> wrapper url. Fare riferimento a <xref linkend="wrappers"/> + per avere la lista di quali wrapper supportano <function>unlink</function>. + </simpara> + </note> + <note> + <simpara> + Il parametro <parameter>context</parameter> è stato aggiunto in <literal>PHP 5.0.0</literal>. + </simpara> + </note> <para> Restituisce 0 o &false; in caso d'errore. </para>