cvs: phpdoc-it /reference/filesystem/functions basename.xml chgrp.xml chmod.xml chown.xml clearstatcache.xml copy.xml delete.xml dirname.xml
disk-free-space.xml disk-total-space.xml diskfreespace.xml

From: Date: Fri, 10 Oct 2003 19:49:00 +0000
Subject: cvs: phpdoc-it /reference/filesystem/functions basename.xml chgrp.xml chmod.xml chown.xml clearstatcache.xml copy.xml delete.xml dirname.xml
disk-free-space.xml disk-total-space.xml diskfreespace.xml
Groups: php.doc.it 
Request: Send a blank email to doc-it+get-465@lists.php.net to get a copy of this message
darvina Fri Oct 10 15:49:00 2003 EDT Modified files: /phpdoc-it/reference/filesystem/functions basename.xml chgrp.xml chmod.xml chown.xml clearstatcache.xml copy.xml delete.xml dirname.xml disk-free-space.xml disk-total-space.xml diskfreespace.xml Log: Sync to En tree

Index: phpdoc-it/reference/filesystem/functions/basename.xml diff -u phpdoc-it/reference/filesystem/functions/basename.xml:1.2 phpdoc-it/reference/filesystem/functions/basename.xml:1.3 --- phpdoc-it/reference/filesystem/functions/basename.xml:1.2 Wed Apr 17 03:06:34 2002 +++ phpdoc-it/reference/filesystem/functions/basename.xml Fri Oct 10 15:48:59 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> <!-- last change to 'basename' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> +<!-- EN-Revision: 1.3 Maintainer: cortesi Status: working --> <!-- OLD-Revision: 1.134/EN.1.2 --> <refentry id="function.basename"> <refnamediv> @@ -32,9 +32,11 @@ <title>Esempio di <function>basename</function></title> <programlisting role="php"> <![CDATA[ +<?php $path = "/home/httpd/html/index.php"; $file = basename ($path); // la variabile $file contiene "index.php" $file = basename ($path,".php"); // la variabile $file contiene "index" +?> ]]> </programlisting> </example> Index: phpdoc-it/reference/filesystem/functions/chgrp.xml diff -u phpdoc-it/reference/filesystem/functions/chgrp.xml:1.2 phpdoc-it/reference/filesystem/functions/chgrp.xml:1.3 --- phpdoc-it/reference/filesystem/functions/chgrp.xml:1.2 Wed Apr 17 03:06:35 2002 +++ phpdoc-it/reference/filesystem/functions/chgrp.xml Fri Oct 10 15:48:59 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> <!-- last change to 'chgrp' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> +<!-- EN-Revision: 1.4 Maintainer: cortesi Status: working --> <!-- OLD-Revision: 1.134/EN.1.2 --> <refentry id="function.chgrp"> <refnamediv> @@ -11,7 +11,7 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>int</type><methodname>chgrp</methodname> + <type>bool</type><methodname>chgrp</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam><type>mixed</type><parameter>group</parameter></methodparam> </methodsynopsis> @@ -27,8 +27,7 @@ <para> Vedere anche <function>chown</function> e <function>chmod</function>. - </para> - &note.no-windows; + </para> </refsect1> </refentry> Index: phpdoc-it/reference/filesystem/functions/chmod.xml diff -u phpdoc-it/reference/filesystem/functions/chmod.xml:1.3 phpdoc-it/reference/filesystem/functions/chmod.xml:1.4 --- phpdoc-it/reference/filesystem/functions/chmod.xml:1.3 Wed May 29 06:57:32 2002 +++ phpdoc-it/reference/filesystem/functions/chmod.xml Fri Oct 10 15:48:59 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.2 Maintainer: spisto Status: ready --> +<!-- EN-Revision: 1.8 Maintainer: spisto Status: ready --> <!-- CREDITS: cortesi --> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> <refentry id="function.chmod"> @@ -10,7 +10,7 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>int</type><methodname>chmod</methodname> + <type>bool</type><methodname>chmod</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam><type>int</type><parameter>mode</parameter></methodparam> </methodsynopsis> @@ -24,12 +24,48 @@ assunto come valore ottale, per cui le stringhe (come "g+w") non verranno elaborate correttamente. Per ottenere l'operazione desiderata, è necessario far iniziare <parameter>mode</parameter> con uno zero (0): + </para> + <para> <informalexample> <programlisting role="php"> <![CDATA[ +<?php chmod ("/somedir/somefile", 755); // decimale; probabilmente errato chmod ("/somedir/somefile", "u+rwx,go+rx"); // stringa; errato chmod ("/somedir/somefile", 0755); // ottale; valore corretto di mode +?> +]]> + </programlisting> + </informalexample> + </para> + <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. + 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 + si assegna il permesso di lettura del file. Aggiungere questi + numeri per ottenere i diritti richiesti. Si possono avere maggiori + dettagli sui permessi dei sistemi UNIX usando il comando 'man 1 chmod' e 'man 2 chmod'. + </para> + <para> + <informalexample> + <programlisting role="php"> +<![CDATA[ +<?php +// Lettura e scrittura per il proprietatio, e nessun permesso per gli altri +chmod ("/somedir/somefile", 0600); + +// Lettura e scrittura per il proprietatio, e lettura per gli altri +chmod ("/somedir/somefile", 0644); + +// Accesso completo per il proprietatio, 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 +chmod ("/somedir/somefile", 0750); +?> ]]> </programlisting> </informalexample> @@ -37,11 +73,21 @@ <para> &return.success; </para> + <note> + <para> + L'utente corrente è l'utente con il quale viene eseguito il PHP. + Probabilmente non è il medesimo utente che si usa da shell o + dall'accesso FTP. + </para> + </note> + + &note.no-remote; + <para> Vedere anche <function>chown</function> e <function>chgrp</function>. </para> - &note.no-windows; + </refsect1> </refentry> Index: phpdoc-it/reference/filesystem/functions/chown.xml diff -u phpdoc-it/reference/filesystem/functions/chown.xml:1.3 phpdoc-it/reference/filesystem/functions/chown.xml:1.4 --- phpdoc-it/reference/filesystem/functions/chown.xml:1.3 Wed May 29 06:57:32 2002 +++ phpdoc-it/reference/filesystem/functions/chown.xml Fri Oct 10 15:48:59 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.2 Maintainer: spisto Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: spisto Status: ready --> <!-- CREDITS: cortesi --> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> <refentry id="function.chown"> @@ -10,7 +10,7 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>int</type><methodname>chown</methodname> + <type>bool</type><methodname>chown</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam><type>mixed</type><parameter>user</parameter></methodparam> </methodsynopsis> @@ -22,11 +22,11 @@ <para> &return.success; </para> + &note.no-remote; <para> Vedere anche <function>chown</function> e <function>chmod</function>. </para> - &note.no-windows; </refsect1> </refentry> Index: phpdoc-it/reference/filesystem/functions/clearstatcache.xml diff -u phpdoc-it/reference/filesystem/functions/clearstatcache.xml:1.2 phpdoc-it/reference/filesystem/functions/clearstatcache.xml:1.3 --- phpdoc-it/reference/filesystem/functions/clearstatcache.xml:1.2 Wed Apr 17 03:06:35 2002 +++ phpdoc-it/reference/filesystem/functions/clearstatcache.xml Fri Oct 10 15:48:59 2003 @@ -1,12 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'clearstatcache' 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.clearstatcache"> <refnamediv> <refname>clearstatcache</refname> - <refpurpose>Libera la cache dallo stat</refpurpose> + <refpurpose>Libera la cache dello stato di un file</refpurpose> </refnamediv> <refsect1> <title>Descrizione</title> @@ -15,15 +12,25 @@ <void/> </methodsynopsis> <para> - Invocare le funzioni di sistema <systemitem>stat</systemitem> o - <systemitem>lstat</systemitem> comporta un buon dispendio di risorse - nella maggioranza dei sistemi. Tuttavia, il risultato del'ultima chiamata - ad una qualunque funzione di stato (elencate sotto) viene memorizzato per - utilizzarlo sulla successiva chiamata analoga allo stesso file. - Se intendi forzare una nuova verifica di stato, per esempio perchè - il file è stato verificato molte volte e può cambiare o sparire, puoi usare - questa funzione per liberare la memoria dai risultati dell'ultima chiamata. + 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, + 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 + si può volere cancellare le informazioni memorizzate. Per queste situazioni si può utilizzare la funzione + <function>clearstatcache</function> che cancella le informazioni memorizzate dal PHP sullo + stato di un file. </para> + <note> + <para> + Queste funzioni memorizzano informazioni su specifici file, pertanto basta + eseguire <function>clearstatcache</function> nel caso di molteplici operazioni + sul medesimo file oppure nel caso sia necessario non memorizzare informazioni + su un dato file. + </para> + </note> <para> Tale valore viene memorizzato solo per la durata di una singola richiesta. </para> Index: phpdoc-it/reference/filesystem/functions/copy.xml diff -u phpdoc-it/reference/filesystem/functions/copy.xml:1.3 phpdoc-it/reference/filesystem/functions/copy.xml:1.4 --- phpdoc-it/reference/filesystem/functions/copy.xml:1.3 Wed May 29 06:13:44 2002 +++ phpdoc-it/reference/filesystem/functions/copy.xml Fri Oct 10 15:48:59 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.2 Maintainer: spisto Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: spisto Status: ready --> <!-- CREDITS: cortesi --> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> <refentry id="function.copy"> @@ -10,20 +10,22 @@ <refsect1> <title>Descrizione</title> <methodsynopsis> - <type>int</type><methodname>copy</methodname> + <type>bool</type><methodname>copy</methodname> <methodparam><type>string</type><parameter>source</parameter></methodparam> <methodparam><type>string</type><parameter>dest</parameter></methodparam> </methodsynopsis> <para> - Copia un file. Restituisce &true; se la copia riesce, - &false; altrimenti. + Copia il file <parameter>source</parameter> in + <parameter>dest</parameter>. &return.success; <example> <title><function>copy</function> example</title> <programlisting role="php"> <![CDATA[ +<?php if (!copy($file, $file.'.bak')) { print ("Copia di $file non riuscita ...<br>\n"); } +?> ]]> </programlisting> </example> @@ -33,6 +35,8 @@ Come da PHP 4.3.0, sia <parameter>source</parameter> che <parameter>dest</parameter> potrebbero essere URL se "fopen wrappers" è stato abilitato. Vedere <function>fopen</function> per ulteriori dettagli. + Se il parametro <parameter>dest</parameter> punta ad un URL, l'operazione di copia + potrebbe fallir se il wrapper non supporta la sovrascrittura di file esistenti. </para> </note> <warning> Index: phpdoc-it/reference/filesystem/functions/delete.xml diff -u phpdoc-it/reference/filesystem/functions/delete.xml:1.2 phpdoc-it/reference/filesystem/functions/delete.xml:1.3 --- phpdoc-it/reference/filesystem/functions/delete.xml:1.2 Wed Apr 17 03:06:35 2002 +++ phpdoc-it/reference/filesystem/functions/delete.xml Fri Oct 10 15:48:59 2003 @@ -1,12 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> -<!-- last change to 'delete' 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.3 Maintainer: cortesi Status: working --> <refentry id="function.delete"> <refnamediv> <refname>delete</refname> - <refpurpose>Una funzione che non c'è</refpurpose> + <refpurpose>Vedere <function>unlink</function> oppure <function>unset</function></refpurpose> </refnamediv> <refsect1> <title>Descrizione</title> Index: phpdoc-it/reference/filesystem/functions/dirname.xml diff -u phpdoc-it/reference/filesystem/functions/dirname.xml:1.2 phpdoc-it/reference/filesystem/functions/dirname.xml:1.3 --- phpdoc-it/reference/filesystem/functions/dirname.xml:1.2 Wed Apr 17 03:06:35 2002 +++ phpdoc-it/reference/filesystem/functions/dirname.xml Fri Oct 10 15:48:59 2003 @@ -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 'dirname' 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.dirname"> <refnamediv> <refname>dirname</refname> @@ -28,28 +26,31 @@ <title><function>dirname</function> example</title> <programlisting role="php"> <![CDATA[ +<?php $path = "/etc/passwd"; $file = dirname ($path); // $file contiene "/etc" +?> ]]> </programlisting> </example> </para> <note> <para> - In PHP 4.0.3, <function>dirname</function> was fixed to be - POSIX-compliant. Essentially, this means that if there are no - slashes in <parameter>path</parameter> , a dot - ('<literal>.</literal>') is returned, indicating the current - directory. Otherwise, the returned string is - <parameter>path</parameter> with any trailing - <literal>/component</literal> removed. Note that this means that - you will often get a slash or a dot back from - <function>dirname</function> in situations where the older - functionality would have given you the empty string. + In PHP 4.0.3, la funzione <function>dirname</function> è stata modificata per essere conforme alle specifiche + POSIX. Essenzialmente ciò significa che non ci sono slash + nel parametro <parameter>path</parameter> , viene restuito un punto + ('<literal>.</literal>') per indicare la directory + corrente. In altro modo, la stringa restituita è + <parameter>path</parameter> senza alcun + <literal>/component</literal>. Occorre notare che ciò implica che spesso + dalla funzione <function>dirname</function> si ottiene uno slash od un punto nei casi + in cui la vecchia versione avrebbe restituito una + stringa vuota. </para> </note> <para> - Vedere anche: <function>basename</function> + Vedere anche: <function>basename</function>, <function>pathinfo</function> e + <function>realpath</function>. </para> </refsect1> </refentry> Index: phpdoc-it/reference/filesystem/functions/disk-free-space.xml diff -u phpdoc-it/reference/filesystem/functions/disk-free-space.xml:1.3 phpdoc-it/reference/filesystem/functions/disk-free-space.xml:1.4 --- phpdoc-it/reference/filesystem/functions/disk-free-space.xml:1.3 Wed May 29 06:13:44 2002 +++ phpdoc-it/reference/filesystem/functions/disk-free-space.xml Fri Oct 10 15:48:59 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.2 Maintainer: spisto Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: spisto Status: ready --> <!-- CREDITS: cortesi --> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> <refentry id="function.disk-free-space"> @@ -23,12 +23,20 @@ <title>Esempio <function>disk_free_space</function></title> <programlisting role="php"> <![CDATA[ -$df = disk_free_space("/"); // $df contiene il numero di byte - // disponibili in "/" +<?php +// $df contiene il numero di byte disponibili in "/" +$df = disk_free_space("/"); +?> ]]> </programlisting> </example> </para> + + &note.no-remote; + + <simpara> + Vedere anche <function>disk_total_space</function> + </simpara> </refsect1> </refentry> Index: phpdoc-it/reference/filesystem/functions/disk-total-space.xml diff -u phpdoc-it/reference/filesystem/functions/disk-total-space.xml:1.2 phpdoc-it/reference/filesystem/functions/disk-total-space.xml:1.3 --- phpdoc-it/reference/filesystem/functions/disk-total-space.xml:1.2 Wed Apr 17 03:06:36 2002 +++ phpdoc-it/reference/filesystem/functions/disk-total-space.xml Fri Oct 10 15:48:59 2003 @@ -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 'disk-total-space' in en/ tree in rev 1.64 --> -<!-- EN-Revision: 1.2 Maintainer: cortesi Status: working --> -<!-- OLD-Revision: 1.134/EN.1.64 --> +<!-- EN-Revision: 1.3 Maintainer: cortesi Status: working --> <refentry id="function.disk-total-space"> <refnamediv> <refname>disk_total_space</refname> @@ -24,12 +21,19 @@ <title><function>disk_total_space</function> example</title> <programlisting role="php"> <![CDATA[ -$df = disk_total_space("/"); // $df contiene il numero totale di - // byte disponibile su "/" +// $df contiene il numero totale di byte disponibile su "/" +$df = disk_total_space("/"); +?> ]]> </programlisting> </example> </para> + + &note.no-remote; + + <simpara> + Vedere anche <function>disk_free_space</function> + </simpara> </refsect1> </refentry> Index: phpdoc-it/reference/filesystem/functions/diskfreespace.xml diff -u phpdoc-it/reference/filesystem/functions/diskfreespace.xml:1.3 phpdoc-it/reference/filesystem/functions/diskfreespace.xml:1.4 --- phpdoc-it/reference/filesystem/functions/diskfreespace.xml:1.3 Wed May 29 06:13:44 2002 +++ phpdoc-it/reference/filesystem/functions/diskfreespace.xml Fri Oct 10 15:48:59 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.2 Maintainer: spisto Status: ready --> +<!-- EN-Revision: 1.4 Maintainer: spisto Status: ready --> <!-- CREDITS: cortesi --> <!-- splitted from ./it/functions/filesystem.xml, last change in rev 1.15 --> <refentry id="function.diskfreespace"> @@ -9,14 +9,8 @@ </refnamediv> <refsect1> <title>Descrizione</title> - <methodsynopsis> - <type>float</type><methodname>diskfreespace</methodname> - <methodparam><type>string</type><parameter>directory</parameter></methodparam> - </methodsynopsis> <para> - Questo alias di - <function>disk_free_space</function> è stato disapprovato. - Usare invece quella funzione. + Questa funzione è un alias di <function>disk_free_space</function>. </para> </refsect1> </refentry>
« previous php.doc.it (#465) next »