cvs: phpdoc /pt_BR/functions filesystem.xml
| From: | Renato Arruda | Date: | Sat, 01 Dec 2001 14:53:09 +0000 |
| Subject: | cvs: phpdoc /pt_BR/functions filesystem.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969339384@lists.php.net to get a copy of this message | ||
rarruda Sat Dec 1 09:53:09 2001 EDT
Modified files:
/phpdoc/pt_BR/functions filesystem.xml
Log:
File fully translated (but not revised yet).
Index: phpdoc/pt_BR/functions/filesystem.xml diff -u phpdoc/pt_BR/functions/filesystem.xml:1.5 phpdoc/pt_BR/functions/filesystem.xml:1.6 --- phpdoc/pt_BR/functions/filesystem.xml:1.5 Thu Nov 15 09:59:55 2001 +++ phpdoc/pt_BR/functions/filesystem.xml Sat Dec 1 09:53:09 2001 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <reference id="ref.filesystem"> <title>Funções do Filesystem</title> <titleabbrev>Filesystem</titleabbrev> @@ -17,18 +17,18 @@ <funcprototype> <funcdef>string <function>basename</function></funcdef> <paramdef>string <parameter>path</parameter></paramdef> - <paramdef>string <parameter><optional>suffixo</optional></parameter></paramdef> + <paramdef>string <parameter><optional>sufixo</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <para> Dado uma string contendo um path para um arquivo, essa função irá retornar o nome base do arquivo. - Se o nome do arquivo é terminado em um <parameter>suffixo</parameter> - este tambem será retirado. + Se o nome do arquivo é terminado em um <parameter>sufixo</parameter> + este também será retirado. </para> <para> No Windows, tanto a barra (<literal>/</literal>) quanto a - barrainvertida (<literal>\</literal>) são usadas como caracter de + barra invertida (<literal>\</literal>) são usadas como caracter de separacao do path. Em outros ambientes, somente a barra (<literal>/</literal>). </para> @@ -44,7 +44,7 @@ </para> <note> <para> - O parametro <parameter>suffixo</parameter> foi adicionado no PHP 4.1.0. + O parametro <parameter>sufixo</parameter> foi adicionado no PHP 4.1.0. </para> </note> <para> @@ -111,7 +111,7 @@ </para> <para> Note que <parameter>mode</parameter> não é assumido ser um numero - octal, então strings (como "g+w") não irá funcionar. Para garantir + octal, então strings (como "g+w") não funcionarão. Para garantir que a operação seja bem sucedide é necessário o prefixo zero (0) em <parameter>mode</parameter>: <informalexample> @@ -297,7 +297,7 @@ </para> <para> No Windows, tanto barra (<literal>/</literal>) quanto a - barrainvertida (<literal>\</literal>) são usadas como caracter + barra invertida (<literal>\</literal>) são usadas como caracter separador no path. Em outros ambientes é utilizado a barra (<literal>/</literal>).</para> <para> @@ -402,7 +402,7 @@ <refpurpose>Fecha um ponteiro de arquivo aberto</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>fclose</function></funcdef> @@ -442,7 +442,7 @@ (eof) ou um erro ocorrer, caso contrário retorna &false;. </para> <para> - O ponteir para o arquivo tem que ser válido e tem que apontar para + O ponteiro para o arquivo tem que ser válido e tem que apontar para um arquivo aberto com sucesso por <function>fopen</function>, <function>popen</function>, ou <function>fsockopen</function>. </para> @@ -452,7 +452,7 @@ <refentry id="function.fflush"> <refnamediv> <refname>fflush</refname> - <refpurpose>Forca a ida da saida para o arquivo</refpurpose> + <refpurpose>Força a ida da saida para o arquivo</refpurpose> </refnamediv> <refsect1> <title>Descrição</title> @@ -481,7 +481,7 @@ <refentry id="function.fgetc"> <refnamediv> <refname>fgetc</refname> - <refpurpose>Lê caracter do ponteiro de arquivo</refpurpose> + <refpurpose>Ler caracter do ponteiro de arquivo</refpurpose> </refnamediv> <refsect1> <title>Descrição</title> @@ -581,7 +581,7 @@ <refentry id="function.fgets"> <refnamediv> <refname>fgets</refname> - <refpurpose>Lê a linha de um ponteiro de arquivo</refpurpose> + <refpurpose>Ler a linha de um ponteiro de arquivo</refpurpose> </refnamediv> <refsect1> <title>Descrição</title> @@ -642,41 +642,40 @@ <refnamediv> <refname>fgetss</refname> <refpurpose> - Gets line from file pointer and strip HTML tags + Ler uma linha de um ponteiro de arquivo e retira as tags HTML </refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>string <function>fgetss</function></funcdef> <paramdef>int <parameter>fp</parameter></paramdef> - <paramdef>int <parameter>length</parameter></paramdef> + <paramdef>int <parameter>comprimento</parameter></paramdef> <paramdef>string <parameter> - <optional>allowable_tags</optional> + <optional>tags_permitidas</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> - Identical to <function>fgets</function>, except that fgetss - attempts to strip any HTML and PHP tags from the text it - reads. + Identico a <function>fgets</function>, exceto que fgetss + tenta retirar qualquer tag HTML ou PHP do texto que ele lê. </para> <para> - You can use the optional third parameter to specify tags which - should not be stripped. + Você pode retirar o terceiro parametro opcional para especificar + quais tags não devem ser retiradas. <note> <para> - <parameter>allowable_tags</parameter> was added in PHP 3.0.13, + <parameter>tags_permitidas</parameter> foi adicionada no PHP 3.0.13, PHP4B3. </para> </note> </para> <para> - See also <function>fgets</function>, <function>fopen</function>, - <function>fsockopen</function>, <function>popen</function>, and + Veja também <function>fgets</function>, <function>fopen</function>, + <function>fsockopen</function>, <function>popen</function>, e <function>strip_tags</function>. </para> </refsect1> @@ -685,49 +684,49 @@ <refentry id="function.file"> <refnamediv> <refname>file</refname> - <refpurpose>Reads entire file into an array</refpurpose> + <refpurpose>Ler um arquivo inteiro para um array</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>array <function>file</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> <paramdef>int <parameter><optional>use_include_path</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> <para> - Identical to <function>readfile</function>, except that - <function>file</function> returns the file in an array. Each - element of the array corresponds to a line in the file, with the - newline still attached. + Identico a <function>readfile</function>, exceto que + <function>file</function> returna o arquivo no array. Cada + elemento do array corresponde a uma linha no arquivo, inclusive + com o caracter de nova linha. </para> <para> - You can use the optional second parameter and set it to "1", if - you want to search for the file in the <link - linkend="ini.include-path">include_path</link>, too. + Você pode usar o segundo parametro opcional como "1", se voce + deseja procurar o arquivo no <link + linkend="ini.include-path">include_path</link> também. </para> <para> <informalexample> <programlisting role="php"> <?php -// get a web page into an array and print it out +// ler uma webpage para um array e o imprimir $fcontents = file ('http://www.php.net'); while (list ($line_num, $line) = each ($fcontents)) { - echo "<b>Line $line_num:</b> " . htmlspecialchars ($line) . "<br>\n"; + echo "<b>Linha $line_num:</b> " . htmlspecialchars ($line) . "<br>\n"; } -// get a web page into a string +// ler uma web paga para uma string $fcontents = join ('', file ('http://www.php.net')); ?> </programlisting> </informalexample> </para> - <para> - See also <function>readfile</function>, - <function>fopen</function>, <function>fsockopen</function>, and + <para> + Veja também <function>readfile</function>, + <function>fopen</function>, <function>fsockopen</function>, e <function>popen</function>. </para> </refsect1> @@ -737,28 +736,28 @@ <refentry id="function.file-exists"> <refnamediv> <refname>file_exists</refname> - <refpurpose>Checks whether a file exists</refpurpose> + <refpurpose>Checar se um arquivo existe</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>file_exists</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <simpara> - Returns &true; if the file specified by - <parameter>filename</parameter> exists; &false; otherwise. + Retorna &true; se o arquivo expecificado por + <parameter>nomedoarquivo</parameter> existe; &false; caso contrário. </simpara> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não irá funcionar em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + para ser examinado tem que ser accessivel pelo filesystem do servidor. </simpara> <simpara> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados no cache. Veja + <function>clearstatcache</function> para mais detalhes. </simpara> </refsect1> </refentry> @@ -767,38 +766,40 @@ <refentry id="function.fileatime"> <refnamediv> <refname>fileatime</refname> - <refpurpose>Gets last access time of file</refpurpose> + <refpurpose>Obtém o último tempo de acesso do arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fileatime</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <simpara> + Retorna o tempo que o arquivo foi acessado por último, ou &false; + em caso de erro. O tempo que é retornado é um timestamp UNIX. Returns the time the file was last accessed, or &false; in case of an error. The time is returned as a Unix timestamp. </simpara> <simpara> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </simpara> <simpara> - Note: The atime of a file is supposed to change whenever - the data blocks of a file are being read. This can be - costly performancewise when an application regularly - accesses a very large number of files or directories. Some - Unix filesystems can be mounted with atime updates disabled - to increase the performance of such applications; USENET - news spools are a common example. On such filesystems - this function will be useless. - </simpara> - <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Nota: O atime do arquivo deve mudar para quando os blocos + de informação do arquivo são lidos. Isto pode ser caro + em termos de performance quando uma aplicação frequentemente + acessa um numero muito grande de arquivos ou diretórios. + Alguns filesystems Unix podem ser montados com updates dos + atimes desabilitados para aumentar a performance destas + aplicações; USENET news spools é um exemplo comum. Nestes + filesystems esta função é inútil. + </simpara> + <simpara> + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + a ser examinado tem que ser acessível pelo filesystem do servidor. </simpara> </refsect1> </refentry> @@ -806,41 +807,44 @@ <refentry id="function.filectime"> <refnamediv> <refname>filectime</refname> - <refpurpose>Gets inode change time of file</refpurpose> + <refpurpose>Ler o tempo de modificação do inode do arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>filectime</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns the time the file was last changed, or &false; in case of - an error. The time is returned as a Unix timestamp. + Retorna o tempo em que o arquivo foi modificado pela última vez, + ou &false; em caso de erro. O tempo é retornado como um timestamp + Unix. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <para> - Note: In most Unix filesystems, a file is considered - changed when its inode data is changed; that is, when - the permissions, owner, group, or other metadata - from the inode is updated. See also - <function>filemtime</function> (which is what you want to use - when you want to create "Last Modified" footers on web pages) and - <function>fileatime</function>. - </para> - <para>Note also that in some Unix texts the ctime of a file is - referred to as being the creation time of the file. This is wrong. - There is no creation time for Unix files in most Unix filesystems. + Nota: Na maior parte dos filesystems Unix, um arquivo é + considerado modificado quando a informação do inode é + modificada; isto é, quando as permissões, dono (owner), + grupo (group), ou outra metadata do inode é modificada. + Veja também <function>filemtime</function> (o que é o que + você deseja usar quando criando rodapés com informações + sobre última vez que o arquivo foi modificado em web pages) + e <function>fileatime</function>. + </para> + <para>Note também que em alguns textos Unix o ctime do arquivo + é referido como sendo o tempo de criação do tempo do arquivo. + Isto é errado. Não há tempo de criação de arquivos Unix na + maior parte dos filesystems Unix. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não irá funcionar em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + a ser examinado tem que ser acessivel pelo filesystem do servidor. </simpara> </refsect1> </refentry> @@ -848,33 +852,35 @@ <refentry id="function.filegroup"> <refnamediv> <refname>filegroup</refname> - <refpurpose>Gets file group</refpurpose> + <refpurpose>Ler o grupo do arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>filegroup</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> - <para> - Returns the group ID of the owner of the file, or &false; in case - of an error. The group ID is returned in numerical format, use - <function>posix_getgrgid</function> to resolve it to a group name. + <para> + Retorna o group ID do dono do arquivo, ou &false; no caso de um + erro. O group ID é retornado em um formato numérico, use + <function>posix_getgrgid</function> para resolver para o nome do + grupo. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + O resultado desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <note> <simpara> - This function does not work on Windows systems + Esta função não funciona em sistemas Windows </simpara> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não irá funcionar em <link + linkend="features.remote-files">arquivos remotos</link>; o + arquivo a ser examinado tem que ser acessivel atravez do + filesystem do servidor. </simpara> </note> </refsect1> @@ -883,31 +889,32 @@ <refentry id="function.fileinode"> <refnamediv> <refname>fileinode</refname> - <refpurpose>Gets file inode</refpurpose> + <refpurpose>Ler o inode do arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fileinode</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns the inode number of the file, or &false; in case of an - error.</para> + Retorna o numero do inode do arquivo, ou &false; em caso de erro. + </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o + arquivo a ser examinado tem que ser acessivel pelo filesystem + do servidor. </simpara> <note> <simpara> - This function does not work on Windows systems + Esta função não funciona em sistemas Windows </simpara> </note> </refsect1> @@ -916,34 +923,35 @@ <refentry id="function.filemtime"> <refnamediv> <refname>filemtime</refname> - <refpurpose>Gets file modification time</refpurpose> + <refpurpose>Ler o tempo de modificação do arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>filemtime</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns the time the file was last modified, or &false; in case of - an error. The time is returned as a Unix timestamp. + Retorna o tempo em que o arquivo foi modificado pela última vez, ou + &false; em caso de erro. O tempo é retornado como um timestamp Unix. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o + arquivo a ser examinado tem que ser acessivel pelo filesystem + do servidor. </simpara> - <para>Note: This function returns the time when the data - blocks of a file were being written to, that is, the time - when the content of the file was changed. Use - <function>date</function> on the result of this function - to get a printable modification date for use in page footers. + <para>Nota: Esta função retorna o tempo quando os blocos de + informação do arquivo são escritos, isto é, o tempo quando o + conteúdo do arquivo foi mudado. Para obter uma data de + modificação para utilizar em rodapés use a função + <function>date</function>. </para> </refsect1> </refentry> @@ -951,33 +959,34 @@ <refentry id="function.fileowner"> <refnamediv> <refname>fileowner</refname> - <refpurpose>Gets file owner</refpurpose> + <refpurpose>Ler o dono(owner) do arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fileowner</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> - <para> - Returns the user ID of the owner of the file, or &false; in case of - an error. The user ID is returned in numerical format, use - <function>posix_getpwuid</function> to resolve it to a username. + <para> + Retorna o ID do usuário(user ID) do dono(owner) do arquivo, ou &false; + caso um erro ocorra. O ID do usuário é retornado no formato numérico, + use <function>posix_getpwuid</function> para obter o username do + usuário. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + a ser examinado tem que ser acessivel pelo filesystem do servidor. </simpara> <note> <simpara> - This function does not work on Windows systems + Esta função não funciona em sistemas Windows </simpara> </note> </refsect1> @@ -986,27 +995,27 @@ <refentry id="function.fileperms"> <refnamediv> <refname>fileperms</refname> - <refpurpose>Gets file permissions</refpurpose> + <refpurpose>Ler as permissões do arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fileperms</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcprototype> </funcsynopsis> - <para> - Returns the permissions on the file, or &false; in case of an error. + <para> + Retorna as permissões do arquivo, ou &false; em caso de erro. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + a ser examinado tem que ser acessivel pelo filesystem do servidor. </simpara> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> </refsect1> </refentry> @@ -1014,22 +1023,22 @@ <refentry id="function.filesize"> <refnamediv> <refname>filesize</refname> - <refpurpose>Gets file size</refpurpose> + <refpurpose>Ler o tamanho do arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>filesize</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns the size of the file, or &false; in case of an error. + Retorna o tamanho do arquivo, ou &false; em caso de erro. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <simpara> This function will not work on <link @@ -1042,29 +1051,29 @@ <refentry id="function.filetype"> <refnamediv> <refname>filetype</refname> - <refpurpose>Gets file type</refpurpose> + <refpurpose>Ler o tipo de arquivo (file type)</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>string <function>filetype</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> - <para> - Returns the type of the file. Possible values are fifo, char, - dir, block, link, file, and unknown.</para> <para> Returns &false; - if an error occurs. + <para> + Retorna o tipo do arquivo(file type). Valores possiveis são + fifo, char, block, link, file e unknown(desconhecido).</para> + <para> Retorna &false; se um erro ocorrer. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + a ser examinado tem que ser acessivel pelo filesystem do servidor. </simpara> </refsect1> </refentry> @@ -1075,12 +1084,12 @@ <refpurpose>Portable advisory file locking</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>flock</function></funcdef> <paramdef>int <parameter>fp</parameter></paramdef> - <paramdef>int <parameter>operation</parameter></paramdef> + <paramdef>int <parameter>operacao</parameter></paramdef> <paramdef>int <parameter> <optional>wouldblock</optional> @@ -1089,66 +1098,66 @@ </funcprototype> </funcsynopsis> <simpara> - PHP supports a portable way of locking complete files in an - advisory way (which means all accessing programs have to use the - same way of locking or it will not work). + PHP suporta uma maneira portável de lock arquivos completos + em uma advisory way (que significa que todos os programas acessando + tem que usar a mesma maneira de locking ou não irá funcionar). </simpara> <simpara> - <function>flock</function> operates on <parameter>fp</parameter> - which must be an open file - pointer. <parameter>operation</parameter> is one of the following - values: + <function>flock</function> opera em <parameter>fp</parameter>, + que tem que ser um ponteiro de arquivo aberto com sucesso. + <parameter>operacao</parameter> é um dos seguintes valores: </simpara> <para> <itemizedlist> <listitem> <simpara> - To acquire a shared lock (reader), set - <parameter>operation</parameter> to LOCK_SH (set to 1 prior to - PHP 4.0.1). + Para obter uma lock compartilhada (leitura), use + <parameter>operacao</parameter> como LOCK_SH (use 1 se a versão + do PHP for anterior a 4.0.1). </simpara> </listitem> <listitem> <simpara> - To acquire an exclusive lock (writer), set - <parameter>operation</parameter> to LOCK_EX (set to 2 prior to - PHP 4.0.1). + Para obter uma lock exclusiva (gravação), use + <parameter>operacao</parameter> como LOCK_EX (use 2 se a versão + do PHP for anterior a 4.0.1). </simpara> </listitem> <listitem> <simpara> - To release a lock (shared or exclusive), set - <parameter>operation</parameter> to LOCK_UN (set to 3 prior to - PHP 4.0.1). + Para retirar uma lock (compartilhada ou exclusiva), use + <parameter>operacao</parameter> como LOCK_UN (use 3 se a versão + do PHP for anterior a 4.0.1). </simpara> </listitem> <listitem> <simpara> - If you don't want <function>flock</function> to block while - locking, add LOCK_NB (4 prior to PHP 4.0.1) to - <parameter>operation</parameter>. + Se você não quer usar <function>flock</function> para + bloquear enquanto locking, addicione LOCK_NB (3 se a versão + do PHP for anterior a 4.0.1) a <parameter>operacao</parameter>. </simpara> </listitem> </itemizedlist> </para> <simpara> - <function>flock</function> allows you to perform a simple - reader/writer model which can be used on virtually every platform - (including most Unices and even Windows). The optional 3rd - argument is set to &true; if the lock would block (EWOULDBLOCK - errno condition) + <function>flock</function> permite que você possa fazer um simples + modelo leitura/gravação (reader/writer) que pode ser usado em + virtualmente todas as plataformas (incluindo a maior parte dos + Unixes e até mesmo Windows). O terceiro argumento opcional é usado + como &true; se a lock iria bloquear (EWOULDBLOCK errno condition) </simpara> <simpara> - <function>flock</function> returns &true; on success and &false; on - error (e.g. when a lock could not be acquired). + <function>flock</function> retorna &true; em caso de sucesso e + &false; em caso de erro (por exemplo quando uma lock não pode + ser obtida). </simpara> <warning> <para> - On most operation systems <function>flock</function> is implemented - at the process level. When using a multithreaded server API like - ISAPI you cannot rely on <function>flock</function> to protect - files against other PHP scripts running in parallel threads of the - same server instance! + Na maior parte dos sistemas operacionais <function>flock</function> + é implementada no nível do processo. Quando usando um servidor + com um multithreaded API como ISAPI você não pode confiar no + <function>flock</function> para proteger os arquivos contra outros + scripts PHP rodando em threads paralelos do mesmo servidor. </para> </warning> </refsect1> @@ -1157,14 +1166,14 @@ <refentry id="function.fopen"> <refnamediv> <refname>fopen</refname> - <refpurpose>Opens file or URL</refpurpose> + <refpurpose>Abrir um arquivo ou uma URL</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fopen</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> <paramdef>string <parameter>mode</parameter></paramdef> <paramdef>int <parameter> @@ -1174,123 +1183,126 @@ </funcprototype> </funcsynopsis> <simpara> - If <parameter>filename</parameter> begins with "http://" (not - case sensitive), an HTTP 1.0 connection is opened to the - specified server, the page is requested using the HTTP GET - method, and a file pointer is returned to the beginning - of the body of the response. A 'Host:' header is sent with the - request in order to handle name-based virtual hosts. + Se <parameter>nomedoarquivo</parameter> começa com "http://" + (não diferencia entre caracteres maiusculas e minusculas), + uma conexão HTTP 1.0 é aberta para o servidor especificado, a + página é requisitada usando o método HTTP GET, e um ponteiro + de arquivo é retornado no começo do corpo da resposta. O + cabeçalho 'Host:' é enviado com o pedido para que virtual + hosts baseados em nomes sejam suportados. </simpara> <simpara> - Note that the file pointer allows you to retrieve only the - <emphasis>body</emphasis> of the response; you cannot - access the HTTP response header using this function. + Note que o ponteiro de arquivo deixa você retirar somente o + corpo(<emphasis>body</emphasis>) da resposta; você não pode + acessar o cabeçalho de resposta HTTP usando esta função. </simpara> <simpara> - Versions prior to PHP 4.0.5 do not handle HTTP redirects. Because - of this, directories must include trailing slashes. + Versões anteriores a PHP 4.0.5 não suportam redirecionamentos HTTP. + Por causa disso, diretórios devem incluir a barra no final. </simpara> <simpara> - If <parameter>filename</parameter> begins with "ftp://" (not case - sensitive), an ftp connection to the specified server is opened - and a pointer to the requested file is returned. If the server - does not support passive mode ftp, this will fail. You can open - files for either reading or writing via ftp (but not both - simultaneously). + Se <parameter>nomedoarquivo</parameter> começa com "ftp://" (não + diferencia entre caracteres maiusculas e minusculas também), uma + conexão para o servidor especificado é aberta e um ponteiro para o + arquivo perdido é retornado. Se o servidor não suporta modo passivo, + isto irá falhar. Você pode abrir arquivos tanto para leitura quanto + para gravação via ftp (mas não para ambos simultâneamente). </simpara> <simpara> - If <parameter>filename</parameter> is one of "php://stdin", - "php://stdout", or "php://stderr", the corresponding stdio - stream will be opened. (This was introduced in PHP 3.0.13; - in earlier versions, a filename such as "/dev/stdin" or - "/dev/fd/0" must be used to access the stdio streams.) + Se <parameter>nomedoarquivo</parameter> é ou "php://stdin", + ou "php://stdout", ou "php://stderr", o correspondente stream + stdio será aberto. (Isto foi introduziso no PHP 3.0.13; em + versões anteriores, um nome de arquivo como "/dev/stdin" ou + "/dev/fd/0" deve ser usado para acessar os streams stdio.) </simpara> <simpara> - If <parameter>filename</parameter> begins with anything else, the - file will be opened from the filesystem, and a file pointer to - the file opened is returned. + Se <parameter>nomedoarquivo</parameter> começa com qualquer outra + coisa, o arquivo será aberto no filesystem e um ponteiro para o + arquivo será retornado. </simpara> <simpara> - If the open fails, the function returns &false;. + Se a abertura falhar, a função retornará &false;. </simpara> <para> - <parameter>mode</parameter> may be any of the following: + <parameter>mode</parameter> pode ser qualquer um dos seguintes: <itemizedlist> <listitem> <simpara> - 'r' - Open for reading only; place the file pointer at the - beginning of the file. + 'r' - Abrir somente para leitura; coloca o ponteiro de arquivo + no começo do arquivo. </simpara> </listitem> <listitem> <simpara> - 'r+' - Open for reading and writing; place the file pointer at - the beginning of the file. + 'r+' - Abrir para leitura e gravação; colocar o ponteiro de + arquivo no começo do arquivo. </simpara> </listitem> <listitem> <simpara> - 'w' - Open for writing only; place the file pointer at the - beginning of the file and truncate the file to zero length. - If the file does not exist, attempt to create it. + 'w' - Abrir somente para gravação; colocar o ponteiro de + arquivo no começo do arquivo e truncar o arquivo para tamanho + zero. Se o arquivo não existir, tentar cria-lo. </simpara> </listitem> <listitem> <simpara> - 'w+' - Open for reading and writing; place the file pointer at - the beginning of the file and truncate the file to zero - length. If the file does not exist, attempt to create it. + 'w+' - Abrir para leitura e escrita; colocar o ponteiro de + arquivo no início do arquivo e truncar o arquivo para tamanho + zero. Se o arquivo não existir, tentar cria-lo. </simpara> </listitem> <listitem> <simpara> - 'a' - Open for writing only; place the file pointer at the end - of the file. If the file does not exist, attempt to create - it. + 'a' - Abrir o arquivo somente para escrita; colocar o ponteiro + de arquivo no fim do arquivo. Se o arquivo não existe, tentar + cria-lo. </simpara> </listitem> <listitem> <simpara> - 'a+' - Open for reading and writing; place the file pointer at - the end of the file. If the file does not exist, attempt to - create it. + 'a+' - Abrir o arquivo para leitura e gravação; colocar o + ponteiro no fim do arquivo. Se o arquivo não existe, tentar + cria-lo. </simpara> </listitem> </itemizedlist> </para> <note> <para> - The <parameter>mode</parameter> may contain the letter - 'b'. This is useful only on systems which differentiate between - binary and text files (i.e. Windows. It's useless on Unix). - If not needed, this will be ignored. + O <parameter>mode</parameter> pode conter a letra 'b'. Isto é + útil somente em sistemas que diferenciam entre arquivos + binários e texto (por exemplo Windows. É inútil em Unix). + Se não nescessário, será ignorado. </para> </note> <para> - You can use the optional third parameter and set it to "1", if - you want to search for the file in the <link - linkend="ini.include-path">include_path</link>, too. + Você pode usar o terceiro parametro opctional como "1", se você + quer procurar pelo arquivo no <link + linkend="ini.include-path">include_path</link>, também. </para> <para> <example> - <title><function>fopen</function> example</title> + <title>exemplo do <function>fopen</function></title> <programlisting role="php"> -$fp = fopen ("/home/rasmus/file.txt", "r"); -$fp = fopen ("/home/rasmus/file.gif", "wb"); +$fp = fopen ("/home/rasmus/arquivo.txt", "r"); +$fp = fopen ("/home/rasmus/arquivo.gif", "wb"); $fp = fopen ("http://www.php.net/", "r"); -$fp = fopen ("ftp://user:password@example.com/", "w"); +$fp = fopen ("ftp://usuario:senha@exemplo.com.br/", "w"); </programlisting> </example> </para> <simpara> - If you are experiencing problems with reading and writing to - files and you're using the server module version of PHP, remember - to make sure that the files and directories you're using are - accessible to the server process. + Se você está tendo problemas com a leitura e gravação para + arquivos e você está usando a versão de modulo de servidor do + PHP, lembre-se de ter certeza que os arquivos e diretórios que + você está usando precisam ser acessíveis ao processo do servidor + de HTTP. </simpara> <para> - On the Windows platform, be careful to escape any backslashes - used in the path to the file, or use forward slashes. + Na plataforma Windows, tenha cuidado para usar uma segunda + barra invertida (escape) usada no path de um arquivo, ou usar + a barra normal. <informalexample> <programlisting role="php"> $fp = fopen ("c:\\data\\info.txt", "r"); @@ -1298,9 +1310,9 @@ </informalexample> </para> <simpara> - See also <function>fclose</function>, + Veja também <function>fclose</function>, <function>fsockopen</function>, - <function>socket_set_timeout</function>, and + <function>socket_set_timeout</function>, e <function>popen</function>. </simpara> </refsect1> @@ -1310,11 +1322,11 @@ <refnamediv> <refname>fpassthru</refname> <refpurpose> - Output all remaining data on a file pointer + Imprime todo o restante de um ponteiro de arquivo </refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fpassthru</function></funcdef> @@ -1322,28 +1334,28 @@ </funcprototype> </funcsynopsis> <simpara> - Reads to EOF on the given file pointer and writes the results to - standard output. + Lê até o fim do arquivo (EOF) do ponteiro de arquivo dado e + imprime os resultados para a saída normal (standard output). </simpara> <simpara> - If an error occurs, <function>fpassthru</function> returns - &false;. + Se um error ocorrer, a função <function>fpassthru</function> + retorna &false;. </simpara> <simpara> - The file pointer must be valid, and must point to a file - successfully opened by <function>fopen</function>, - <function>popen</function>, or <function>fsockopen</function>. - The file is closed when <function>fpassthru</function> is done - reading it (leaving <parameter>fp</parameter> useless). + O ponteiro de arquivo tem que ser válido e apontar para um + arquivo aberto com sucesso por <function>fopen</function>, + <function>popen</function>, ou <function>fsockopen</function>. + O arquivo é fechado quando <function>fpassthru</function> + acaba de ler (deixando <parameter>fp</parameter> sem utilidade). </simpara> <simpara> - If you just want to dump the contents of a file to stdout you may - want to use the <function>readfile</function>, which saves you - the <function>fopen</function> call. + Se você quiser somente jogar o conteúdo do arquivo para stout você + pode querer usar a função <function>readfile</function>, que vai + salvar a você a chamada a função <function>fopen</function>. </simpara> <simpara> - See also <function>readfile</function>, - <function>fopen</function>, <function>popen</function>, and + Veja também <function>readfile</function>, + <function>fopen</function>, <function>popen</function>, e <function>fsockopen</function> </simpara> </refsect1> @@ -1352,10 +1364,10 @@ <refentry id="function.fputs"> <refnamediv> <refname>fputs</refname> - <refpurpose>Writes to a file pointer</refpurpose> + <refpurpose>Escrever para um ponteiro de arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fputs</function></funcdef> @@ -1363,16 +1375,16 @@ <paramdef>string <parameter>str</parameter></paramdef> <paramdef>int <parameter> - <optional>length</optional> + <optional>comprimento</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> - <function>fputs</function> is an alias to - <function>fwrite</function>, and is identical in every way. Note - that the <parameter>length</parameter> parameter is optional and - if not specified the entire string will be written. + <function>fputs</function> é uma função sinônima (alias) para + <function>fwrite</function>, e é identica em todas as maneiras. + Note que o parametro <parameter>comprimento</parameter> é opcional + e se não for especificado a string inteira será escrita. </para> </refsect1> </refentry> @@ -1380,57 +1392,57 @@ <refentry id="function.fread"> <refnamediv> <refname>fread</refname> - <refpurpose>Binary-safe file read</refpurpose> + <refpurpose>Leitura binary-safe de arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>string <function>fread</function></funcdef> <paramdef>int <parameter>fp</parameter></paramdef> - <paramdef>int <parameter>length</parameter></paramdef> + <paramdef>int <parameter>comprimento</parameter></paramdef> </funcprototype> </funcsynopsis> <simpara> - <function>fread</function> reads up to - <parameter>length</parameter> bytes from the file pointer - referenced by <parameter>fp</parameter>. Reading stops when - <parameter>length</parameter> bytes have been read or EOF is - reached, whichever comes first. + <function>fread</function> lê até + <parameter>comprimento</parameter> bytes. A leitura é + interrompida quando <parameter>comprimento</parameter> + bytes foram lidos ou o fim do arquivo (eof) foi alcançado, + o que ocorrer primeiro. </simpara> <para> <informalexample> <programlisting role="php"> -// get contents of a file into a string -$filename = "/usr/local/something.txt"; -$fd = fopen ($filename, "r"); -$contents = fread ($fd, filesize ($filename)); +// ler o conteúdo do arquivo para uma string +$nomedoarquivo = "/usr/local/algo.txt"; +$fd = fopen ($nomedoarquivo, "r"); +$conteudo = fread ($fd, filesize ($nomedoarquivo)); fclose ($fd); </programlisting> </informalexample> </para> <note> <para> - On systems which differentiate between binary and text files - (i.e. Windows) the file must be opened with 'b' included in - <function>fopen</function> mode parameter. + Em sistemas que diferenciam entre arquivos binários e texto + (por exemplo Windows) o arquivo tem que ser aberto com 'b' + incluído como parametro na função <function>fopen</function>. </para> </note> <para> <informalexample> <programlisting role="php"> -$filename = "c:\\files\\somepic.gif"; -$fd = fopen ($filename, "rb"); -$contents = fread ($fd, filesize ($filename)); +$nomedoarquivo = "c:\\arquivos\\algumaimg.gif"; +$fd = fopen ($nomedoarquivo, "rb"); +$conteudo = fread ($fd, filesize ($nomedoarquivo)); fclose ($fd); </programlisting> </informalexample> </para> <simpara> - See also <function>fwrite</function>, <function>fopen</function>, + Veja também <function>fwrite</function>, <function>fopen</function>, <function>fsockopen</function>, <function>popen</function>, <function>fgets</function>, <function>fgetss</function>, - <function>fscanf</function>, <function>file</function>, and + <function>fscanf</function>, <function>file</function>, e <function>fpassthru</function>. </simpara> </refsect1> @@ -1439,37 +1451,37 @@ <refentry id="function.fscanf"> <refnamediv> <refname>fscanf</refname> - <refpurpose>Parses input from a file according to a format</refpurpose> + <refpurpose>Parses a entrada de um arquivo de acordo com um formato</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>mixed <function>fscanf</function></funcdef> <paramdef>int <parameter>handle</parameter></paramdef> - <paramdef>string <parameter>format</parameter></paramdef> + <paramdef>string <parameter>formato</parameter></paramdef> <paramdef>string <parameter><optional>var1</optional></parameter>... </paramdef> </funcprototype> </funcsynopsis> <para> - The function <function>fscanf</function> is similar to - <function>sscanf</function>, but it takes its input from a file - associated with <parameter>handle</parameter> and interprets the - input according to the specified - <parameter>format</parameter>. If only two parameters were passed - to this function, the values parsed will be returned as an array. - Otherwise, if optional parameters are passed, the function will - return the number of assigned values. The optional parameters - must be passed by reference. + A função <function>fscanf</function> é semelhante a + <function>sscanf</function>, mas usa como entrada um arquivo + associado com <parameter>handle</parameter> e interpreta a + entrada de acordo com o <parameter>formato</parameter> + especificado. Se somente dois parametros forem passados a esta + função, os valores parsed serão retornados como um array. + De outro modo, se parametros opcionais são passados a função + irá retornar o número de valores utilizados. Os parametros opcionais + tem que ser passados por referência. <example> - <title><function>fscanf</function> Example</title> + <title>Exemplo do <function>fscanf</function></title> <programlisting role="php"> $fp = fopen ("users.txt","r"); while ($userinfo = fscanf ($fp, "%s\t%s\t%s\n")) { - list ($name, $profession, $countrycode) = $userinfo; - //... do something with the values + list ($name, $profission, $countrycode) = $userinfo; + //... fazer algo com os valores } fclose($fp); </programlisting> @@ -1477,17 +1489,17 @@ <example> <title>users.txt</title> <programlisting> -javier argonaut pe -hiroshi sculptor jp -robert slacker us -luigi florist it +javier argonauta pe +hiroshi escultor jp +robert tradutor us +luigi florista it </programlisting> </example> </para> <para> - See also <function>fread</function>, <function>fgets</function>, + Veja também <function>fread</function>, <function>fgets</function>, <function>fgetss</function>, <function>sscanf</function>, - <function>printf</function>, and <function>sprintf</function>. + <function>printf</function>, e <function>sprintf</function>. </para> </refsect1> </refentry> @@ -1495,10 +1507,10 @@ <refentry id="function.fseek"> <refnamediv> <refname>fseek</refname> - <refpurpose>Seeks on a file pointer</refpurpose> + <refpurpose>Procura (seeks) em um ponteiro de arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fseek</function></funcdef> @@ -1510,40 +1522,41 @@ </funcprototype> </funcsynopsis> <para> - Sets the file position indicator for the file referenced by - <parameter>fp</parameter>.The new position, measured in bytes - from the beginning of the file, is obtained by adding - <parameter>offset</parameter> to the position specified by - <parameter>whence</parameter>, whose values are defined as - follows: + Modifica o indicador de posição do arquivo referenciado por + <parameter>fp</parameter>. A nova posição é obtida, medindo em + bytes do início do arquivo, é obtida ao adicionar + <parameter>offset</parameter> a posição especificada por + <parameter>whence</parameter>, cujo valor é definido como + se segue: <simplelist> - <member>SEEK_SET - Set position equal to - <parameter>offset</parameter> bytes.</member> <member>SEEK_CUR - - Set position to current location plus - <parameter>offset</parameter>.</member> <member>SEEK_END - Set - position to end-of-file plus - <parameter>offset</parameter>.</member> + <member>SEEK_SET - Use a posição igual à <parameter>offset</parameter> + bytes. </member> <member>SEEK_CUR - Use a posição para a + localização atual mais <parameter>offset</parameter>.</member> + <member>SEEK_END - Use a posição para o fim do arquivo (eof) + mais <parameter>offset</parameter>.</member> </simplelist> </para> - <para>If <parameter>whence is not specified, it is assumed to be - SEEK_SET.</parameter> + <para>Se <parameter>whence</parameter> não é especificado é + presumido ser SEEK_SET.</parameter> </para> <para> - Upon success, returns 0; otherwise, returns -1. Note that seeking - past EOF is not considered an error. + Em caso de sucesso, retorna 0; caso contrário, retorna -1. Note + que fazer um seek depois do fim do arquivo (eof) é considerado + um erro. </para> <para> - May not be used on file pointers returned by - <function>fopen</function> if they use the "http://" or "ftp://" - formats. + Não pode ser usado em ponteiros de arquivo retornados por + <function>fopen</function> se for usado o formato "http://" + ou "ftp://". </para> <note> <para> - The <parameter>whence</parameter> argument was added after PHP 4.0 RC1. + O argumento <parameter>whence</parameter> foi adicionado depois do + PHP 4.0 RC1. </para> </note> <para> - See also <function>ftell</function> and + Veja também <function>ftell</function> e <function>rewind</function>. </para> </refsect1> @@ -1553,11 +1566,11 @@ <refnamediv> <refname>fstat</refname> <refpurpose> - Gets information about a file using an open file pointer + Ler a informação sobre um arquivo usando um ponteiro de arquivo aberto </refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>array <function>fstat</function></funcdef> @@ -1565,33 +1578,33 @@ </funcprototype> </funcsynopsis> <para> - Gathers the statistics of the file opened by the file - pointer fp. This function is similar to the - <function>stat</function> function except that it operates - on an open file pointer instead of a filename. + Mantém estatísticas do arquivo aberto pelo ponteiro de + arquivos fp. Esta função é similar a função + <function>stat</function> exceto que ela opera em um + ponteiro de arquivo aberto ao invéz de um nome de arquivo. </para> <para> - Returns an array with the statistics of the file with the - following elements: + Retorna um array com as estatísticas do arquico com os seguintes + elementos: <orderedlist> <listitem><simpara>device</simpara></listitem> <listitem><simpara>inode</simpara></listitem> - <listitem><simpara>number of links</simpara></listitem> - <listitem><simpara>user id of owner</simpara></listitem> - <listitem><simpara>group id owner</simpara></listitem> - <listitem><simpara>device type if inode device *</simpara></listitem> - <listitem><simpara>size in bytes</simpara></listitem> - <listitem><simpara>time of last access</simpara></listitem> - <listitem><simpara>time of last modification</simpara></listitem> - <listitem><simpara>time of last change</simpara></listitem> - <listitem><simpara>blocksize for filesystem I/O *</simpara></listitem> - <listitem><simpara>number of blocks allocated</simpara></listitem> + <listitem><simpara>número de links</simpara></listitem> + <listitem><simpara>user id do dono (owner)</simpara></listitem> + <listitem><simpara>group id (owner)</simpara></listitem> + <listitem><simpara>tipo de device se inode device *</simpara></listitem> + <listitem><simpara>tamanho em bytes</simpara></listitem> + <listitem><simpara>tempo do último acesso</simpara></listitem> + <listitem><simpara>tempo da última modificação(modification)</simpara></listitem> + <listitem><simpara>tempo da última mudança(change)</simpara></listitem> + <listitem><simpara>tamanho do bloco para o filesystem I/O *</simpara></listitem> + <listitem><simpara>número de blocos alocados</simpara></listitem> </orderedlist> - * - only valid on systems supporting the st_blksize type--other - systems (i.e. Windows) return -1</para> + * - somente válido em sistemas suportando o tipo st_blksize--outros + sistemas (por exemplo Windows) retornam -1</para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> </refsect1> </refentry> @@ -1599,10 +1612,10 @@ <refentry id="function.ftell"> <refnamediv> <refname>ftell</refname> - <refpurpose>Tells file pointer read/write position</refpurpose> + <refpurpose>Diz ao ponteiro de arquivo a posição de leitura/gravação</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ftell</function></funcdef> @@ -1610,20 +1623,20 @@ </funcprototype> </funcsynopsis> <para> - Returns the position of the file pointer referenced by fp; i.e., - its offset into the file stream. + Retorna a posição do ponteiro de arquivo referenciado por fp; por + exemplo o seu offset no file stream. </para> <para> - If an error occurs, returns &false;. + Se um error ocorrer, retorna &false;. </para> <para> - The file pointer must be valid, and must point to a file - successfully opened by <function>fopen</function> or + O ponteiro de arquivo tem que ser válidoe apontar para um + arquivo aberto com sucesso por <function>fopen</function> ou <function>popen</function>. </para> <para> - See also <function>fopen</function>, <function>popen</function>, - <function>fseek</function> and <function>rewind</function>. + Veja também <function>fopen</function>, <function>popen</function>, + <function>fseek</function> e <function>rewind</function>. </para> </refsect1> </refentry> @@ -1632,21 +1645,25 @@ <refnamediv> <refname>ftruncate</refname> <refpurpose> - Truncates a file to a given length. + Corta um arquivo para um tamanho especificado. </refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ftruncate</function></funcdef> <paramdef>int <parameter>fp</parameter></paramdef> - <paramdef>int <parameter>size</parameter></paramdef> + <paramdef>int <parameter>comprimento</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Takes the filepointer, fp, and truncates the file to length, size. - This function returns &true; on success and &false; on failure. + Pega o ponteiro de arquivo, fp, e corta o arquivo no comprimento + especificado. O arquivo final terá os + <paramenter>comprimento</parameter> bytes iniciais idênticos ao + arquivo original. + Esta função retorna &true; em caso de sucesso e &false; em caso + de falha. </para> </refsect1> </refentry> @@ -1654,10 +1671,10 @@ <refentry id="function.fwrite"> <refnamediv> <refname>fwrite</refname> - <refpurpose>Binary-safe file write</refpurpose> + <refpurpose>Gravação em arquivos binary-safe</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fwrite</function></funcdef> @@ -1665,37 +1682,37 @@ <paramdef>string <parameter>string</parameter></paramdef> <paramdef>int <parameter> - <optional>length</optional> + <optional>comprimento</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <simpara> - <function>fwrite</function> writes the contents of - <parameter>string</parameter> to the file stream pointed to by - <parameter>fp</parameter>. If the <parameter>length</parameter> - argument is given, writing will stop after - <parameter>length</parameter> bytes have been written or the end - of <parameter>string</parameter> is reached, whichever comes - first. + <function>fwrite</function> grava os conteúdos de + <parameter>string</parameter> para o stream de arquivo apontado + por <parameter>fp</parameter>. Se o argumento + <parameter>comprimento</parameter> é dado, a gravação irá parar + depois de que <parameter>comprimento</parameter> bytes foram + escritos ou o fim da <parameter>string</parameter> é alcançada, + o que ocorrer primeiro. </simpara> <simpara> - Note that if the <parameter>length</parameter> argument is given, - then the <link + Note que se o argumento <parameter>comprimento</parameter> é dado, + então a opção de configuração <link linkend="ini.magic-quotes-runtime">magic_quotes_runtime</link> - configuration option will be ignored and no slashes will be - stripped from <parameter>string</parameter>. + será ignorada e nenhuma barra será retirada do + <parameter>string</parameter>. </simpara> <note> <para> - On systems which differentiate between binary and text files - (i.e. Windows) the file must be opened with 'b' included in - <function>fopen</function> mode parameter. + Em sistemas que diferenciam entre arquivos binários e texto + (por exemplo Windows) o arquivo tem que ser aberto com 'b' + incluído no parametro mode do <function>fopen</function>. </para> </note> <simpara> - See also <function>fread</function>, <function>fopen</function>, - <function>fsockopen</function>, <function>popen</function>, and + Veja também <function>fread</function>, <function>fopen</function>, + <function>fsockopen</function>, <function>popen</function> e <function>fputs</function>. </simpara> </refsect1> @@ -1705,11 +1722,11 @@ <refnamediv> <refname>set_file_buffer</refname> <refpurpose> - Sets file buffering on the given file pointer + Configura o buffer de um ponteiro de arquivo </refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>set_file_buffer</function></funcdef> @@ -1718,31 +1735,34 @@ </funcprototype> </funcsynopsis> <simpara> - Output using <function>fwrite</function> is normally buffered at - 8K. This means that if there are two processess wanting to write - to the same output stream (a file), each is paused after 8K of - data to allow the other to write. <function>set_file_buffer</function> - sets the buffering for write operations on the given filepointer - <parameter>fp</parameter> to <parameter>buffer</parameter> bytes. - If <parameter>buffer</parameter> is 0 then write operations are - unbuffered. This ensures that all writes with - <function>fwrite</function> are completed before other processes - are allowed to write to that output stream. - </simpara> - <simpara> - The function returns 0 on success, or EOF if the request cannot - be honored. - </simpara> - <para> - The following example demonstrates how to use - <function>set_file_buffer</function> to create an unbuffered stream. + A saída usando <function>fwrite</function> é normalmente + guardada em um buffer de 8K. Isto significa que se se tem + dois processos querendo gravar no mesmo stream de saída (output) + (um arquivo), cada um é pausado depois de 8K de informações para + deixar o outro processo escrever. <function>set_file_buffer</function> + configura o buffer para operações de escrita no dado ponteiro de + arquivo <parameter>fp</parameter> para o <parameter>buffer</parameter> + em bytes. Se <parameter>buffer</parameter> é 0 então as operações + de escrita não utilizarão o buffer. Isso garante que todas + as gravações com <function>fwrite</function> são completadas + antes que outros processos são possibilitados de escreverem + para este stream de saída. + </simpara> + <simpara> + Esta função retorna 0 em caso de sucesso, ou fim do arquivo (eof) + se o pedido não puder ser honrado. + </simpara> + <para> + O seguinte exemplo demonstra como usar + <function>set_file_buffer</function> para criar um stream + sem usar o buffer. <example> - <title><function>set_file_buffer</function> example</title> + <title>exemplo de <function>set_file_buffer</function></title> <programlisting role="php"> -$fp=fopen($file, "w"); +$fp=fopen($arquivo, "w"); if($fp){ set_file_buffer($fp, 0); - fputs($fp, $output); + fputs($fp, $saida); fclose($fp); } </programlisting> @@ -1750,7 +1770,7 @@ </para> <simpara> - See also <function>fopen</function>, <function>fwrite</function>. + Veja também <function>fopen</function> e <function>fwrite</function>. </simpara> </refsect1> </refentry> @@ -1758,30 +1778,30 @@ <refentry id="function.is-dir"> <refnamediv> <refname>is_dir</refname> - <refpurpose>Tells whether the filename is a directory</refpurpose> + <refpurpose>Diz se o arquivo é um diretório</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>is_dir</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedorarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns &true; if the filename exists and is a directory. + Retorna &true; se o nomedoarquivo existe e é um diretório. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. + Veja <function>clearstatcache</function> para mais detalhes. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + a ser examinado tem que ser acessível pelo filesystem do servidor. </simpara> <para> - See also <function>is_file</function> and + Veja também <function>is_file</function> e <function>is_link</function>. </para> </refsect1> @@ -1790,30 +1810,30 @@ <refentry id="function.is-executable"> <refnamediv> <refname>is_executable</refname> - <refpurpose>Tells whether the filename is executable</refpurpose> + <refpurpose>Diz se um arquivo é executável</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>is_executable</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns &true; if the filename exists and is executable. + Retorna &true; se no nomedoarquivo existe e é executável. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + a ser examinado tem que ser acessivel pelo filesystem do servidor. </simpara> <para> - See also <function>is_file</function> and + Veja também <function>is_file</function> e <function>is_link</function>. </para> </refsect1> @@ -1823,26 +1843,26 @@ <refnamediv> <refname>is_file</refname> <refpurpose> - Tells whether the filename is a regular file + Diz se o arquivo é um arquivo comum </refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>is_file</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns &true; if the filename exists and is a regular file. + Retorna &true; se o nome do nomedoarquivo existe e é um arquivo comum. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <para> - See also <function>is_dir</function> and + Veja também <function>is_dir</function> e <function>is_link</function>. </para> </refsect1> @@ -1852,36 +1872,37 @@ <refnamediv> <refname>is_link</refname> <refpurpose> - Tells whether the filename is a symbolic link + Diz se o arquivo é um link simbólico (symbolic link) </refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>is_link</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>arquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns &true; if the filename exists and is a symbolic link. + Retorna &true; se o nomedoarquivo existe e é um link simbólico + (symbolic link). </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <para> - See also <function>is_dir</function> and + Veja também <function>is_dir</function> e <function>is_file</function>. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + a ser examinado tem que ser acessivel pelo filesystem do servidor. </simpara> <note> <simpara> - This function does not work on Windows systems + Esta função não funciona em sistemas Windows </simpara> </note> </refsect1> @@ -1891,36 +1912,36 @@ <refnamediv> <refname>is_readable</refname> <refpurpose> - Tells whether the filename is readable + Diz se o arquivo é legivel (readable) </refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>is_readable</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns &true; if the filename exists and is readable. + Retorna &true; se o nomedoraquivo existe e é legível (readable). </para> <para> - Keep in mind that PHP may be accessing the file as the user - id that the web server runs as (often 'nobody'). Safe mode - limitations are not taken into account. + Lembre-se que o PHP deve estar acessando o arquivo como o mesmo + usuário que o servidor de web roda (frequentemente 'nobody'). + Limitações do safemode não são levadas em consideração. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + a ser examinado tem que ser acessivel pelo filesystem do servidor. </simpara> <para> - See also <function>is_writable</function>. + Veja também <function>is_writable</function>. </para> </refsect1> </refentry> @@ -1928,37 +1949,37 @@ <refentry id="function.is-writable"> <refnamediv> <refname>is_writable</refname> - <refpurpose>Tells whether the filename is writable</refpurpose> + <refpurpose>Diz se pode-se escrever para o arquivo(writable)</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>is_writable</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>arquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns &true; if the filename exists and is writable. The - filename argument may be a directory name allowing you to check - if a directory is writeable. + Retorna &true; se o nomedoarquivo existe e pode ser escrito para. + O argumento nomedoarquivo pode ser um nome de diretório, deixando + você saber se o diretório pode ser escrito para (writeable). </para> <para> - Keep in mind that PHP may be accessing the file as the user id - that the web server runs as (often 'nobody'). Safe mode - limitations are not taken into account. + Lembre-se que o PHP deve estar acessando o arquivo como o mesmo + usuário que o servidor de web roda (frequentemente 'nobody'). + Limitações do safemode não são levadas em consideração. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + a ser examinado tem que ser acessível pelo filesystem do servidor. </simpara> <para> - See also <function>is_readable</function>. + Veja também <function>is_readable</function>. </para> </refsect1> </refentry> @@ -1966,18 +1987,19 @@ <refentry id="function.is-writeable"> <refnamediv> <refname>is_writeable</refname> - <refpurpose>Tells whether the filename is writable</refpurpose> + <refpurpose>Diz se pode-se escrever para o arquivo(writable)</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>is_writeable</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - This is an alias for <function>is_writable</function> + Esta é uma função sinônima (alias) para + <function>is_writable</function> </para> </refsect1> </refentry> @@ -1985,41 +2007,41 @@ <refentry id="function.is-uploaded-file"> <refnamediv> <refname>is_uploaded_file</refname> - <refpurpose>Tells whether the file was uploaded via HTTP POST.</refpurpose> + <refpurpose>Diz se o arquivo foi uploaded via HTTP POST</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>is_uploaded_file</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - This function is available only in versions of PHP 3 after PHP - 3.0.16, and in versions of PHP 4 after 4.0.2. + Esta função é somente disponível em versões do PHP3 depois de + 3.0.16, e em versões do PHP 4 depois de 4.0.2. </para> <para> - Returns &true; if the file named by <varname>filename</varname> was - uploaded via HTTP POST. This is useful to help ensure that a - malicious user hasn't tried to trick the script into working on - files upon which it should not be working--for instance, + Retorna &truel se o arquivo com o nome <varname>nomedoarquivo</varname> + foi uploaded via HTTP POST. Isto é útil para ter certeza que um + usuário malicioso, não está tentando confundir o script em trabalhar + em arquivos que não deve estar trabalhando--por exemplo, <filename>/etc/passwd</filename>. </para> <para> - This sort of check is especially important if there is any chance - that anything done with uploaded files could reveal their - contents to the user, or even to other users on the same - system. + Este tipo de confirmação é importante principalmente se existe + alguma chance que qualquer coisa feita com os arquivos uploadeados + poderiam revelar o seu conteúdo para o usuário, ou mesmo + para outros usuários no mesmo sistema. </para> <para> - See also <function>move_uploaded_file</function>, and the section + Veja também <function>move_uploaded_file</function>, e a seção <link linkend="features.file-upload">Handling file uploads</link> - for a simple usage example. + para um simples exemplo de utilização desta função. </para> </refsect1> </refentry> @@ -2027,27 +2049,27 @@ <refentry id="function.link"> <refnamediv> <refname>link</refname> - <refpurpose>Create a hard link</refpurpose> + <refpurpose>Criando um hard link</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>link</function></funcdef> - <paramdef>string <parameter>target</parameter></paramdef> + <paramdef>string <parameter>alvo</parameter></paramdef> <paramdef>string <parameter>link</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - <function>link</function> creates a hard link.</para> + <function>link</function> cria um hard link.</para> <para> - See also the <function>symlink</function> to create soft links, - and <function>readlink</function> along with + Veja também <function>symlink</function> para criar soft links, + e <function>readlink</function> assim como <function>linkinfo</function>. </para> <note> <simpara> - This function does not work on Windows systems + Esta função não funciona em sistemas Windows </simpara> </note> </refsect1> @@ -2056,10 +2078,10 @@ <refentry id="function.linkinfo"> <refnamediv> <refname>linkinfo</refname> - <refpurpose>Gets information about a link</refpurpose> + <refpurpose>Ler informações sobre um link</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>linkinfo</function></funcdef> @@ -2067,20 +2089,20 @@ </funcprototype> </funcsynopsis> <para> - <function>linkinfo</function> returns the st_dev field of the - UNIX C stat structure returned by the lstat system call. This - function is used to verify if a link (pointed to by - <parameter>path</parameter>) really exists (using the same method - as the S_ISLNK macro defined in stat.h). Returns 0 or &false; in - case of error. + <function>linkinfo</function> retorna o campo st_dev da + structure em C do UNIX retornado pela chamada do sistema + (system call) lstat. Esta função é usada para verificar + se um link (apontado por <parameter>path</parameter>) + realmente existe (usando o mesmo metodo que a macro S_ISLNK + definida em stat.h). Retorna 0 ou &false; em caso de erro. </para> <para> - See also <function>symlink</function>, <function>link</function>, - and <function>readlink</function>. + Veja também <function>symlink</function>, <function>link</function>, + e <function>readlink</function>. </para> <note> <simpara> - This function does not work on Windows systems + Esta função não funciona em sistemas Windows </simpara> </note> </refsect1> @@ -2089,36 +2111,37 @@ <refentry id="function.mkdir"> <refnamediv> <refname>mkdir</refname> - <refpurpose>Makes directory</refpurpose> + <refpurpose>Criar um diretório</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>mkdir</function></funcdef> - <paramdef>string <parameter>pathname</parameter></paramdef> + <paramdef>string <parameter>nomedopath</parameter></paramdef> <paramdef>int <parameter>mode</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Attempts to create the directory specified by pathname. + Tenta criar o diretório especificado por + <parameter>nomedopath</parameter>. </para> <para> - Note that you probably want to specify the mode as an - octal number, which means it should have a leading zero. - The mode is also modified by the current umask, which you - can change using <function>umask</function>. + Note que você provavelmente quer especificar o mode como + um número octal, o que significa que ele deve ter o zero + inicial. O mode é também modificado pela umaks atual, + o que você pode mudar usando <function>umask</function>. <informalexample> <programlisting role="php"> -mkdir ("/path/to/my/dir", 0700); +mkdir ("/path/para/o/meu/dir", 0700); </programlisting> </informalexample> </para> <para> - Returns &true; on success and &false; on failure. + Retorna &true; em sucesso e &false; em caso de falha. </para> <para> - See also <function>rmdir</function>. + Veja também <function>rmdir</function>. </para> </refsect1> </refentry> @@ -2126,58 +2149,58 @@ <refentry id="function.move-uploaded-file"> <refnamediv> <refname>move_uploaded_file</refname> - <refpurpose>Moves an uploaded file to a new location.</refpurpose> + <refpurpose>Move um arquivo uploadeado para uma nova localização</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>move_uploaded_file</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> - <paramdef>string <parameter>destination</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> + <paramdef>string <parameter>destino</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - This function is available only in versions of PHP 3 after PHP - 3.0.16, and in versions of PHP 4 after 4.0.2. + Esta função está disponível somente em versões do PHP 3 depois + da 3.0.16, e em versões do PHP 4 depois da 4.0.2. </para> <para> - This function checks to ensure that the file designated by - <parameter>filename</parameter> is a valid upload file (meaning - that it was uploaded via PHP's HTTP POST upload mechanism). If - the file is valid, it will be moved to the filename given by - <parameter>destination</parameter>. + Esta função checa para ter certeza que o arquivo designado por + <parameter>nomedoarquivo</parameter> é um arquivo válido + uploadeado (significando que ele foi uploadeado pelo mecanismo + do PHP de HTTP POST). Se o arquivo é válido, ele será movido + para o nomedoarquivo dado pelo <parameter>destino</parameter>. </para> <para> - If <parameter>filename</parameter> is not a valid upload file, - then no action will occur, and - <function>move_uploaded_file</function> will return + Se <parameter>nomedoarquivo</parameter> não é um arquivo + uploadeado válido, então não haverá nenhuma ação e + <function>move_uploaded_file</function> irá retornar &false;. &false;. </para> <para> - If <parameter>filename</parameter> is a valid upload file, but - cannot be moved for some reason, no action will occur, and - <function>move_uploaded_file</function> will return - &false;. Additionally, a warning will be issued. + Se <parameter>nomedoarquivo</parameter> é um arquivo uploadeado + válido e não pode ser movido por alguma razão, nenhuma ação + irá ocorrer, e <function>move_uploaded_file</function> irá + retornar &false;. Adicionalmente, um aviso será transmitido. </para> <para> - This sort of check is especially important if there is any chance - that anything done with uploaded files could reveal their - contents to the user, or even to other users on the same - system. + Este tipo de confirmação é importante principalmente se existe + alguma chance que qualquer coisa feita com os arquivos uploadeados + poderiam revelar o seu conteúdo para o usuário, ou mesmo + para outros usuários no mesmo sistema. </para> ¬e.sm.uidcheck; <para> - See also <function>is_uploaded_file</function>, and the section + Veja também <function>is_uploaded_file</function>, e a seção <link linkend="features.file-upload">Handling file uploads</link> - for a simple usage example. + para um simples exemplo de utilização desta função. </para> </refsect1> </refentry> @@ -2185,71 +2208,73 @@ <refentry id="function.parse-ini-file"> <refnamediv> <refname>parse_ini_file</refname> - <refpurpose>Parse a configuration file</refpurpose> + <refpurpose>Parse um arquivo de configuração</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>array <function>parse_ini_file</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> <paramdef>bool <parameter> - <optional>process_sections</optional> + <optional>processar_secoes</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <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; + <function>parse_ini_file</function> carrega no + arquivo ini especificado no + <parameter>nomedoarquivo</parameter>, e retorna as + configurações dele em um array associativo. + Ao usar <parameter>processar_secoes</parameter> como + &true;, você receberá um array multidimensional, com + os nomes das seções e os parametros incluidos. O + padrão (default) para + <parameter>processar_secoes</parameter> é &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. + Esta função não tem nada a ver com o arquivo + <filename>php.ini</filename>. Este já é processado na hora + que você executa o script. Esta função pode ser usada para ler + os arquivos de configuração de sua própria aplicação. </para> </note> <para> - The structure of the ini file is similar to that of - the <filename>php.ini</filename>'s. + A estrutura do arquivo ini é similar a do + <filename>php.ini</filename>. </para> <para> <example> - <title>Contents of sample.ini</title> + <title>Conteúdo de exemplo.ini</title> <programlisting> -; This is a sample configuration file -; Comments start with ';', as in php.ini +; Este é um arquivo de configuração de exemplo +; Comentário começam com ';', como no php.ini -[first_section] -one = 1 -five = 5 +[primeira_secao] +um = 1 +cinco = 5 -[second_section] +[segunda_secao] path = /usr/local/bin </programlisting> </example> </para> <para> <example> - <title><function>parse_ini_file</function> example</title> + <title>exemplo de <function>parse_ini_file</function></title> <programlisting> <![CDATA[ <?php -// Parse without sections -$ini_array = parse_ini_file("sample.ini"); +// Parse sem as seções +$ini_array = parse_ini_file("exemplo.ini"); print_r($ini_array); -// Parse with sections -$ini_array = parse_ini_file("sample.ini", TRUE); +// Parse com as seções +$ini_array = parse_ini_file("exemplo.ini", TRUE); print_r($ini_array); ?> @@ -2263,19 +2288,19 @@ <programlisting> Array ( - [one] => 1 - [five] => 5 + [um] => 1 + [cinco] => 5 [path] => /usr/local/bin ) Array ( - [first_section] => Array + [primeira_secao] => Array ( - [one] => 1 - [five] => 5 + [um] => 1 + [cinco] => 5 ) - [second_section] => Array + [segunda_secao] => Array ( [path] => /usr/local/bin ) @@ -2290,10 +2315,10 @@ <refentry id="function.pathinfo"> <refnamediv> <refname>pathinfo</refname> - <refpurpose>Returns information about a file path</refpurpose> + <refpurpose>Retorna informação sobre o path de um arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>array <function>pathinfo</function></funcdef> @@ -2301,30 +2326,30 @@ </funcprototype> </funcsynopsis> <para> - <function>pathinfo</function> returns an associative array - containing information about <parameter>path</parameter>. The - following array elements are returned: + <function>pathinfo</function> retorna um array associatico + contendo informações sobre o <parameter>path</parameter>. O + seguinte elementos do array são retornados: <parameter>dirname</parameter>, <parameter>basename</parameter> - and <parameter>extension</parameter>. + e <parameter>extension</parameter>. </para> <para> <example> - <title><function>pathinfo</function> Example</title> + <title>Exemplo de <function>pathinfo</function></title> <programlisting role="php"> <?php -$path_parts = pathinfo("/www/htdocs/index.html"); +$partes_do_path = pathinfo("/www/htdocs/index.html"); -echo $path_parts["dirname"] . "\n"; -echo $path_parts["basename"] . "\n"; -echo $path_parts["extension"] . "\n"; +echo $partes_do_path["dirname"] . "\n"; +echo $partes_do_path["basename"] . "\n"; +echo $partes_do_path["extension"] . "\n"; ?> </programlisting> </example> </para> <para> - Would produce: + Produziria: <informalexample> <programlisting> /www/htdocs @@ -2334,9 +2359,9 @@ </informalexample> </para> <para> - See also <function>dirname</function>, + Veja também <function>dirname</function>, <function>basename</function>, <function>parse_url</function> - and <function>realpath</function>. + e <function>realpath</function>. </para> </refsect1> </refentry> @@ -2344,10 +2369,10 @@ <refentry id="function.pclose"> <refnamediv> <refname>pclose</refname> - <refpurpose>Closes process file pointer</refpurpose> + <refpurpose>Fechar um processo de um ponteiro de arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>pclose</function></funcdef> @@ -2355,19 +2380,18 @@ </funcprototype> </funcsynopsis> <para> - Closes a file pointer to a pipe opened by + Fecha um ponteiro de arquivo a uma pipe aberta por <function>popen</function>. </para> - <para> - The file pointer must be valid, and must have been returned by a - successful call to <function>popen</function>. + <para> + O ponteiro de arquivo tem que ser válido e tem que ser retornado + por uma chamada bem sucedida a função <function>popen</function>. </para> <para> - Returns the termination status of the process that was - run. + Retorna o status da terminação do processo que rodava. </para> <para> - See also <function>popen</function>. + Veja também <function>popen</function>. </para> </refsect1> </refentry> @@ -2375,10 +2399,10 @@ <refentry id="function.popen"> <refnamediv> <refname>popen</refname> - <refpurpose>Opens process file pointer</refpurpose> + <refpurpose>Abrir um processo de ponteiro de arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>popen</function></funcdef> @@ -2387,19 +2411,19 @@ </funcprototype> </funcsynopsis> <para> - Opens a pipe to a process executed by forking the command given - by command. + Abre uma pipe para um processo executado ao se dar um fork + para o comando dado por command. </para> - <para> - Returns a file pointer identical to that returned by - <function>fopen</function>, except that it is unidirectional (may - only be used for reading or writing) and must be closed with - <function>pclose</function>. This pointer may be used with - <function>fgets</function>, <function>fgetss</function>, and + <para> + Retorna um ponteiro de arquivo identico ao retornado por + <function>fopen</function>, exceto que ele é unidirecional + (somente pode ser usado para leitura ou gravação) e tem que ser + fechado com pclose. Este ponteiro pode ser usado com + <function>fgets</function>, <function>fgetss</function> e <function>fputs</function>. </para> <para> - If an error occurs, returns &false;. + Caso um erro ocorra retorna &false;. </para> <para> <informalexample> @@ -2409,7 +2433,7 @@ </informalexample> </para> <para> - See also <function>pclose</function>. + Veja também <function>pclose</function>. </para> </refsect1> </refentry> @@ -2417,14 +2441,14 @@ <refentry id="function.readfile"> <refnamediv> <refname>readfile</refname> - <refpurpose>Outputs a file</refpurpose> + <refpurpose>Ler o conteúdo de um arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>readfile</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> <paramdef>int <parameter> <optional>use_include_path</optional> @@ -2433,43 +2457,47 @@ </funcprototype> </funcsynopsis> <para> - Reads a file and writes it to standard output. + Lê um arquivo e escreve o seu conteúdo para a saída padrão + (standard output). </para> <para> - Returns the number of bytes read from the file. If an error - occurs, &false; is returned and unless the function was called as - @readfile, an error message is printed. + Retorna o número de bytes lido do arquivo. Se um error ocorrer, + retorna &false; e ao menos que a função seja chamada como + @readfile, uma mensagem de erro será impressa. </para> <para> - If <parameter>filename</parameter> begins with "http://" - (not case sensitive), an HTTP 1.0 connection is opened to the - specified server and the text of the response is written to - standard output. + Se <parameter>nomedoarquivo</parameter> comeca com "http://" + (não diferencia entre maiúsculas e mínusculas), uma conexão + HTTP 1.0 será aberta para o servidor específicado e o texto + da resposta será escrito para a saída padrão (standard output). </para> <para> - Versions prior to PHP 4.0.5 do not handle HTTP redirects. Because - of this, directories must include trailing slashes. + Versões anteriores a PHP 4.0.5 não comportam redirecionamento de + HTTP. Por causa disto, diretórios tem que incluir a barra ao fim. </para> <para> - If <parameter>filename</parameter> begins with "ftp://" - (not case sensitive), an ftp connection to the specified server is - opened and the requested file is written to standard output. If the server - does not support passive mode ftp, this will fail. + Se <parameter>nomedoarquivo</parameter> começa com "ftp://" + (não diferencia entre maiúsculas e mínusculas), uma conexão + para o servidor especificado é aberta e o arquivo requisitado é + escrito e o arquivo requisitado é escrito para a saída padrão + (standard output). Se o servidor não suporta modo passivo, ista + conexão irá falhar. </para> <para> - If <parameter>filename</parameter> begins with neither - of these strings, the file will be opened from the filesystem and - its contents written to standard output. + Se o <parameter>nomedoarquivo</parameter> não começar com nenhuma + das duas strings acima, o arquivo será aberto do filesystem e + o seu conteúdo escrito para a saída padrão (standard output). </para> <para> - You can use the optional second parameter and set it to "1", if - you want to search for the file in the <link + Você pode usar o segundo parametro opcional e o setar para "1", + se você quiser procurar o arquivo no <link + linkend="ini.include-path">include_path</link>, também. linkend="ini.include-path">include_path</link>, too. </para> <para> - See also <function>fpassthru</function>, + Veja também <function>fpassthru</function>, <function>file</function>, <function>fopen</function>, - <function>include</function>, <function>require</function>, and + <function>include</function>, <function>require</function> e <function>virtual</function>. </para> </refsect1> @@ -2478,10 +2506,10 @@ <refentry id="function.readlink"> <refnamediv> <refname>readlink</refname> - <refpurpose>Returns the target of a symbolic link</refpurpose> + <refpurpose>Retornar o alvo de um link simbólico</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>string <function>readlink</function></funcdef> @@ -2489,18 +2517,18 @@ </funcprototype> </funcsynopsis> <para> - <function>readlink</function> does the same as the readlink C - function and returns the contents of the symbolic link path or 0 - in case of error. + <function>readlink</function> faz o mesmo que a função do C + readlink e retorna os conteúdos do path do link simbólico ou + 0 em caso de erro. </para> <para> - See also <function>symlink</function>, - <function>readlink</function> and + Veja também <function>symlink</function>, + <function>readlink</function> e <function>linkinfo</function>. </para> <note> <simpara> - This function does not work on Windows systems + Esta função não funciona em sistemas Windows </simpara> </note> </refsect1> @@ -2509,23 +2537,23 @@ <refentry id="function.rename"> <refnamediv> <refname>rename</refname> - <refpurpose>Renames a file</refpurpose> + <refpurpose>Renomear um arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>rename</function></funcdef> - <paramdef>string <parameter>oldname</parameter></paramdef> - <paramdef>string <parameter>newname</parameter></paramdef> + <paramdef>string <parameter>nomeantigo</parameter></paramdef> + <paramdef>string <parameter>novonome</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Attempts to rename <parameter>oldname</parameter> to - <parameter>newname</parameter>. + Tenta renomear <parameter>nomeantigo</parameter> para + <parameter>novonome</parameter>. </para> - <para> - Returns &true; on success and &false; on failure. + <para> + Retorna &true; em caso de sucesso, &false; caso contrário. </para> </refsect1> </refentry> @@ -2533,24 +2561,25 @@ <refentry id="function.rewind"> <refnamediv> <refname>rewind</refname> - <refpurpose>Rewind the position of a file pointer</refpurpose> + <refpurpose>Reinicializa a posição do ponteiro de arquivos para o início</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>rewind</function></funcdef> <paramdef>int <parameter>fp</parameter></paramdef> </funcprototype> </funcsynopsis> - <para> - Sets the file position indicator for fp to the beginning of the - file stream.</para> <para> If an error occurs, returns 0.</para> - <para> The file pointer must be valid, and must point to a file - successfully opened by <function>fopen</function>. + <para> + Muda o indicador de ponteiro de arquivo fp para o início do + stream do arquivo.</para> <para> Se um erro ocorrer, + retornará 0.</para> <para> O ponteiro de arquivo tem que ser + válido e tem que apontar para um arquivo que foi aberto com + sucesso por <function>fopen</function>. </para> <para> - See also <function>fseek</function> and + Veja também <function>fseek</function> e <function>ftell</function>. </para> </refsect1> @@ -2560,26 +2589,26 @@ <refentry id="function.rmdir"> <refnamediv> <refname>rmdir</refname> - <refpurpose>Removes directory</refpurpose> + <refpurpose>Remover um diretório</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>rmdir</function></funcdef> - <paramdef>string <parameter>dirname</parameter></paramdef> + <paramdef>string <parameter>nomedodir</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Attempts to remove the directory named by pathname. The directory - must be empty, and the relevant permissions must permit. - this. + Tenta remover o diretório com o nome de nomedodir. O diretório + tem que estar vazio e as permissões relevantes permitam a + esta operação. </para> <para> - If an error occurs, returns 0. + Em caso de erro, retorna 0. </para> <para> - See also <function>mkdir</function>. + Veja também <function>mkdir</function>. </para> </refsect1> </refentry> @@ -2587,49 +2616,50 @@ <refentry id="function.stat"> <refnamediv> <refname>stat</refname> - <refpurpose>Gives information about a file</refpurpose> + <refpurpose>Dar informação sobre um arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>array <function>stat</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Gathers the statistics of the file named by filename. + Pegar estatísticas sobre o arquivo com o nome de nomedoarquivo. </para> <para> - Returns an array with the statistics of the file with the - following elements: + Retorna um array com as estatísticas do arquivo com os seguintes + elementos: <orderedlist> <listitem><simpara>device</simpara></listitem> <listitem><simpara>inode</simpara></listitem> <listitem><simpara>inode protection mode</simpara></listitem> - <listitem><simpara>number of links</simpara></listitem> - <listitem><simpara>user id of owner</simpara></listitem> + <listitem><simpara>número de links</simpara></listitem> + <listitem><simpara>user id owner</simpara></listitem> <listitem><simpara>group id owner</simpara></listitem> <listitem><simpara>device type if inode device *</simpara></listitem> - <listitem><simpara>size in bytes</simpara></listitem> + <listitem><simpara>tamanho em bytes</simpara></listitem> <listitem><simpara>time of last access</simpara></listitem> <listitem><simpara>time of last modification</simpara></listitem> <listitem><simpara>time of last change</simpara></listitem> <listitem><simpara>blocksize for filesystem I/O *</simpara></listitem> <listitem><simpara>number of blocks allocated</simpara></listitem> </orderedlist> - * - only valid on systems supporting the st_blksize type--other - systems (i.e. Windows) return -1. + * - somente válido em sistemas supportando o tipo st_blksize--outros + sistemas (por exemplo Windows) retornam -1. </para> <para> - Returns &false; in case of error. + Retorna &false; em caso de erro. </para> <para> - <function>stat</function> doesn't handle URL as does <function>fopen</function>. + <function>stat</function> não suporta URL ao contrário de + <function>fopen</function>. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> </refsect1> </refentry> @@ -2637,29 +2667,27 @@ <refentry id="function.lstat"> <refnamediv> <refname>lstat</refname> - <refpurpose> - Gives information about a file or symbolic link + <refpurpose>Dar informações sobre um arquivo ou link simbólico </refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>array <function>lstat</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Gathers the statistics of the file or symbolic link named by - filename. This function is identical to the - <function>stat</function> function except that if the - <parameter>filename</parameter> parameter is a symbolic link, the - status of the symbolic link is returned, not the status of the - file pointed to by the symbolic link. + Pega as estatísticas do arquivo ou link simbólico com o nome de + nomedoarquivo. Esta função é identica a <function>stat</function> + exceto que se o parametro <parameter>nomedoarquivo</parameter> + é um link simbólico o status do link simbólico é retornado e não + o status do arquivo apontando pelo link simbólico. </para> <para> - Returns an array with the statistics of the file with the - following elements: + Retorna um array com as estatísticas do arquivo com os seguintes + elementos: <orderedlist> <listitem><simpara>device</simpara></listitem> <listitem><simpara>inode</simpara></listitem> @@ -2675,11 +2703,11 @@ <listitem><simpara>blocksize for filesystem I/O *</simpara></listitem> <listitem><simpara>number of blocks allocated</simpara></listitem> </orderedlist> - * - only valid on systems supporting the st_blksize type--other - systems (i.e. Windows) return -1</para> + * - somente válido em sistemas supportando o tipo st_blksize--outros + sistemas (por exemplo Windows) retornam -1. <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> </refsect1> </refentry> @@ -2687,10 +2715,10 @@ <refentry id="function.realpath"> <refnamediv> <refname>realpath</refname> - <refpurpose>Returns canonicalized absolute pathname</refpurpose> + <refpurpose>Retorna o path absoluto canonicalizado</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>string <function>realpath</function></funcdef> @@ -2698,15 +2726,15 @@ </funcprototype> </funcsynopsis> <para> - <function>realpath</function> expands all symbolic links and - resolves references to '/./', '/../' and extra '/' characters in - the input <parameter>path</parameter> and return the canonicalized - absolute pathname. The resulting path will have no symbolic link, - '/./' or '/../' components. + <function>realpath</function> expande todos os links simbólicos + e resolve referencias para '/./', '/../' e extra caracteres '/' + na entrada pelo <parameter>path</parameter> e retorna o path + absoluto canonicalizado . O path resultante não conterá nenhum + link simbólico ou componentes '/./' e '/../'. </para> <para> <example> - <title><function>realpath</function> example</title> + <title>exemplo de <function>realpath</function></title> <programlisting role="php"> $real_path = realpath ("../../index.php"); </programlisting> @@ -2718,30 +2746,30 @@ <refentry id="function.symlink"> <refnamediv> <refname>symlink</refname> - <refpurpose>Creates a symbolic link</refpurpose> + <refpurpose>Criar um link simbólico</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>symlink</function></funcdef> - <paramdef>string <parameter>target</parameter></paramdef> + <paramdef>string <parameter>alvo</parameter></paramdef> <paramdef>string <parameter>link</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - <function>symlink</function> creates a symbolic link - from the existing <parameter>target</parameter> with - the specified name <parameter>link</parameter>. + <function>symlink</function> cria um link simbólico + do <parameter>alvo</parameter> existente com o nome + especificado em <parameter>link</parameter>. </para> <para> - See also <function>link</function> to create hard links, - and <function>readlink</function> along with + Veja também <function>link</function> para criar hard links, + e <function>readlink</function> junto com <function>linkinfo</function>. </para> <note> <simpara> - This function does not work on Windows systems. + Esta função não funciona em sistemas Windows. </simpara> </note> </refsect1> @@ -2750,10 +2778,10 @@ <refentry id="function.tempnam"> <refnamediv> <refname>tempnam</refname> - <refpurpose>Creates unique file name</refpurpose> + <refpurpose>Criar um nome de arquivo único</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>string <function>tempnam</function></funcdef> @@ -2762,25 +2790,26 @@ </funcprototype> </funcsynopsis> <para> - Creates a unique temporary filename in the specified directory. - If the directory does not exist, <function>tempnam</function> may - generate a filename in the system's temporary directory. - </para> - <para> - Prior to PHP 4.0.6, the behaviour of the - <function>tempnam</function> function was system dependent. On - Windows the TMP environment variable will override the - <parameter>dir</parameter> parameter, on Linux the TMPDIR - environment variable has precedence, while SVR4 will always use - your <parameter>dir</parameter> parameter if the directory it - points to exists. Consult your system documentation on the - tempnam(3) function if in doubt. + Cria um nome de arquivo temporário único no diretório especificado. + Se o diretório não existe, <function>tempnam</function> pode + gerar o nome de arquivo no diretório temporário do sistema. + </para> + <para> + Antes do PHP 4.0.6 o comportamento da função + <function>tempnam</function> era dependente do sistema. + No Windows a váriavel de ambiente do sistema TMP irá + sobresair o parametro <parameter>dir</parameter>, em + Linux a váriavel de ambiente TMPDIR tem precedencia, + enquanto SVR4 irá sempre usar o parametro + <parameter>dir</parameter> se o diretório para o qual + ele aponta existe. Consulte a documentação do seu sistema + para a função tempnam(3) se em dúvida. </para> <para> - Returns the new temporary filename, or the &null; string on - failure. + Retorna o nome temporário do arquivo ou a string &null; em + caso de falha. <example> - <title><function>tempnam</function> example</title> + <title>exemplo de <function>tempnam</function></title> <programlisting role="php"> $tmpfname = tempnam ("/tmp", "FOO"); </programlisting> @@ -2788,14 +2817,14 @@ </para> <note> <simpara> - This function's behavior changed in 4.0.3. The temporary file is also - created to avoid a race condition where the file might appear in the - filesystem between the time the string was generated and before the - the script gets around to creating the file. + O comportamento desta função mudou na versão 4.0.3. O arquivo + temporário é também criado para evitar uma condição de corrida (race) + onde o arquivo pode aparecer no filesystem entre o tempo que a string + foi gerada e antes que o script tem tempo para criar o arquivo. </simpara> </note> <para> - See also <function>tmpfile</function>. + Veja também <function>tmpfile</function>. </para> </refsect1> </refentry> @@ -2803,30 +2832,30 @@ <refentry id="function.tmpfile"> <refnamediv> <refname>tmpfile</refname> - <refpurpose>Creates a temporary file</refpurpose> + <refpurpose>Criar um arquivo temporário</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>tmpfile</function></funcdef> + <funcdef>int <function>arqtmp</function></funcdef> <void/> </funcprototype> </funcsynopsis> <para> - Creates a temporary file with an unique name in write mode, - returning a file handle similar to the one returned by - <function>fopen</function>. - The file is automatically removed when closed (using - <function>fclose</function>), or when the script ends. + Cria um arquivo temporárop com um nome único em modo de + gravação, retornando o handle do arquivo em modo similar ao + retornado por <function>fopen</function>. + O arquivo é automáticamente apagado quando fechado (usando + <function>fclose</function>), ou quando o script acaba. </para> <para> - For details, consult your system documentation on the - <literal>tmpfile(3)</literal> function, as well as the - <filename>stdio.h</filename> header file. + Para detalhes consulte a documentação do seu sistem + na função <literal>tmpfile(3)</literal>, assim como o + header <filename>stdio.h</filename>. </para> <para> - See also <function>tempnam</function>. + Veja também <function>tempnam</function>. </para> </refsect1> </refentry> @@ -2835,39 +2864,39 @@ <refentry id="function.touch"> <refnamediv> <refname>touch</refname> - <refpurpose>Sets modification time of file</refpurpose> + <refpurpose>Mudar o tempo de modificação do arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>touch</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> <paramdef>int <parameter> - <optional>time</optional> + <optional>tempo</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> - Attempts to set the modification time of the file named by - filename to the value given by time. If the option time is not - given, uses the present time. + Tenta mudar o tempo de modificação do arquivo com o nome de + nomedoarquivo para o valor dado por tempo. Se a opção de tempo + não é dada, o tempo atual será usado. </para> <para> - If the file does not exist, it is created. + Se o arquivo não existe, ele é criado. </para> <para> - Returns &true; on success and &false; otherwise. + Retorna &true; em caso de sucesso e &false; caso contrário. <example> - <title><function>touch</function> example</title> + <title>exemplo da função <function>touch</function></title> <programlisting role="php"> -if (touch ($FileName)) { - print "$FileName modification time has been - changed to todays date and time"; +if (touch ($nomedoarquivo)) { + print "o tempo do $nomedoarquivo foi modificado + para o dia e hora de agora"; } else { - print "Sorry Could Not change modification time of $FileName"; + print "Desculpe, não foi possivel modificar o tempo de $nomedoarquivo"; } </programlisting> </example> @@ -2878,10 +2907,10 @@ <refentry id="function.umask"> <refnamediv> <refname>umask</refname> - <refpurpose>Changes the current umask</refpurpose> + <refpurpose>Modificar a umask atual</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>umask</function></funcdef> @@ -2889,17 +2918,18 @@ </funcprototype> </funcsynopsis> <para> - <function>umask</function> sets PHP's umask to mask & 0777 and - returns the old umask. When PHP is being used as a server module, - the umask is restored when each request is finished. + <function>umask</function> modifica o umask do PHP para o mask + & 0777 e retorna o umask antigo. Quando o PHP está sendo + usado como um módulo do servidor o umask é restaurado quando + o pedido acaba. </para> <para> - <function>umask</function> without arguments simply returns the - current umask. + <function>umask</function> sem argumentos simplesmente retorna + o umask atual. </para> <note> <simpara> - This function may not work on Windows systems. + Esta função pode não funcionar em sistemas Windows. </simpara> </note> </refsect1> @@ -2908,29 +2938,29 @@ <refentry id="function.unlink"> <refnamediv> <refname>unlink</refname> - <refpurpose>Deletes a file</refpurpose> + <refpurpose>Deleta um arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>unlink</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Deletes <parameter>filename</parameter>. Similar to the Unix C - unlink() function. + Deleta <parameter>nomedoarquivo</parameter>. Similar a função + C no Unix unlink(). </para> <para> - Returns 0 or &false; on an error. + Retorna 0 ou &falso; em caso de erro. </para> <para> - See also <function>rmdir</function> for removing directories. + Veja também <function>rmdir</function> para remover diretórios. </para> <note> <simpara> - This function may not work on Windows systems. + Esta função pode não funcionar em sistemas Windows. </simpara> </note> </refsect1>
Index: phpdoc/pt_BR/functions/filesystem.xml diff -u phpdoc/pt_BR/functions/filesystem.xml:1.5 phpdoc/pt_BR/functions/filesystem.xml:1.6 --- phpdoc/pt_BR/functions/filesystem.xml:1.5 Thu Nov 15 09:59:55 2001 +++ phpdoc/pt_BR/functions/filesystem.xml Sat Dec 1 09:53:09 2001 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <reference id="ref.filesystem"> <title>Funções do Filesystem</title> <titleabbrev>Filesystem</titleabbrev> @@ -17,18 +17,18 @@ <funcprototype> <funcdef>string <function>basename</function></funcdef> <paramdef>string <parameter>path</parameter></paramdef> - <paramdef>string <parameter><optional>suffixo</optional></parameter></paramdef> + <paramdef>string <parameter><optional>sufixo</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <para> Dado uma string contendo um path para um arquivo, essa função irá retornar o nome base do arquivo. - Se o nome do arquivo é terminado em um <parameter>suffixo</parameter> - este tambem será retirado. + Se o nome do arquivo é terminado em um <parameter>sufixo</parameter> + este também será retirado. </para> <para> No Windows, tanto a barra (<literal>/</literal>) quanto a - barrainvertida (<literal>\</literal>) são usadas como caracter de + barra invertida (<literal>\</literal>) são usadas como caracter de separacao do path. Em outros ambientes, somente a barra (<literal>/</literal>). </para> @@ -44,7 +44,7 @@ </para> <note> <para> - O parametro <parameter>suffixo</parameter> foi adicionado no PHP 4.1.0. + O parametro <parameter>sufixo</parameter> foi adicionado no PHP 4.1.0. </para> </note> <para> @@ -111,7 +111,7 @@ </para> <para> Note que <parameter>mode</parameter> não é assumido ser um numero - octal, então strings (como "g+w") não irá funcionar. Para garantir + octal, então strings (como "g+w") não funcionarão. Para garantir que a operação seja bem sucedide é necessário o prefixo zero (0) em <parameter>mode</parameter>: <informalexample> @@ -297,7 +297,7 @@ </para> <para> No Windows, tanto barra (<literal>/</literal>) quanto a - barrainvertida (<literal>\</literal>) são usadas como caracter + barra invertida (<literal>\</literal>) são usadas como caracter separador no path. Em outros ambientes é utilizado a barra (<literal>/</literal>).</para> <para> @@ -402,7 +402,7 @@ <refpurpose>Fecha um ponteiro de arquivo aberto</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>fclose</function></funcdef> @@ -442,7 +442,7 @@ (eof) ou um erro ocorrer, caso contrário retorna &false;. </para> <para> - O ponteir para o arquivo tem que ser válido e tem que apontar para + O ponteiro para o arquivo tem que ser válido e tem que apontar para um arquivo aberto com sucesso por <function>fopen</function>, <function>popen</function>, ou <function>fsockopen</function>. </para> @@ -452,7 +452,7 @@ <refentry id="function.fflush"> <refnamediv> <refname>fflush</refname> - <refpurpose>Forca a ida da saida para o arquivo</refpurpose> + <refpurpose>Força a ida da saida para o arquivo</refpurpose> </refnamediv> <refsect1> <title>Descrição</title> @@ -481,7 +481,7 @@ <refentry id="function.fgetc"> <refnamediv> <refname>fgetc</refname> - <refpurpose>Lê caracter do ponteiro de arquivo</refpurpose> + <refpurpose>Ler caracter do ponteiro de arquivo</refpurpose> </refnamediv> <refsect1> <title>Descrição</title> @@ -581,7 +581,7 @@ <refentry id="function.fgets"> <refnamediv> <refname>fgets</refname> - <refpurpose>Lê a linha de um ponteiro de arquivo</refpurpose> + <refpurpose>Ler a linha de um ponteiro de arquivo</refpurpose> </refnamediv> <refsect1> <title>Descrição</title> @@ -642,41 +642,40 @@ <refnamediv> <refname>fgetss</refname> <refpurpose> - Gets line from file pointer and strip HTML tags + Ler uma linha de um ponteiro de arquivo e retira as tags HTML </refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>string <function>fgetss</function></funcdef> <paramdef>int <parameter>fp</parameter></paramdef> - <paramdef>int <parameter>length</parameter></paramdef> + <paramdef>int <parameter>comprimento</parameter></paramdef> <paramdef>string <parameter> - <optional>allowable_tags</optional> + <optional>tags_permitidas</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> - Identical to <function>fgets</function>, except that fgetss - attempts to strip any HTML and PHP tags from the text it - reads. + Identico a <function>fgets</function>, exceto que fgetss + tenta retirar qualquer tag HTML ou PHP do texto que ele lê. </para> <para> - You can use the optional third parameter to specify tags which - should not be stripped. + Você pode retirar o terceiro parametro opcional para especificar + quais tags não devem ser retiradas. <note> <para> - <parameter>allowable_tags</parameter> was added in PHP 3.0.13, + <parameter>tags_permitidas</parameter> foi adicionada no PHP 3.0.13, PHP4B3. </para> </note> </para> <para> - See also <function>fgets</function>, <function>fopen</function>, - <function>fsockopen</function>, <function>popen</function>, and + Veja também <function>fgets</function>, <function>fopen</function>, + <function>fsockopen</function>, <function>popen</function>, e <function>strip_tags</function>. </para> </refsect1> @@ -685,49 +684,49 @@ <refentry id="function.file"> <refnamediv> <refname>file</refname> - <refpurpose>Reads entire file into an array</refpurpose> + <refpurpose>Ler um arquivo inteiro para um array</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>array <function>file</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> <paramdef>int <parameter><optional>use_include_path</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> <para> - Identical to <function>readfile</function>, except that - <function>file</function> returns the file in an array. Each - element of the array corresponds to a line in the file, with the - newline still attached. + Identico a <function>readfile</function>, exceto que + <function>file</function> returna o arquivo no array. Cada + elemento do array corresponde a uma linha no arquivo, inclusive + com o caracter de nova linha. </para> <para> - You can use the optional second parameter and set it to "1", if - you want to search for the file in the <link - linkend="ini.include-path">include_path</link>, too. + Você pode usar o segundo parametro opcional como "1", se voce + deseja procurar o arquivo no <link + linkend="ini.include-path">include_path</link> também. </para> <para> <informalexample> <programlisting role="php"> <?php -// get a web page into an array and print it out +// ler uma webpage para um array e o imprimir $fcontents = file ('http://www.php.net'); while (list ($line_num, $line) = each ($fcontents)) { - echo "<b>Line $line_num:</b> " . htmlspecialchars ($line) . "<br>\n"; + echo "<b>Linha $line_num:</b> " . htmlspecialchars ($line) . "<br>\n"; } -// get a web page into a string +// ler uma web paga para uma string $fcontents = join ('', file ('http://www.php.net')); ?> </programlisting> </informalexample> </para> - <para> - See also <function>readfile</function>, - <function>fopen</function>, <function>fsockopen</function>, and + <para> + Veja também <function>readfile</function>, + <function>fopen</function>, <function>fsockopen</function>, e <function>popen</function>. </para> </refsect1> @@ -737,28 +736,28 @@ <refentry id="function.file-exists"> <refnamediv> <refname>file_exists</refname> - <refpurpose>Checks whether a file exists</refpurpose> + <refpurpose>Checar se um arquivo existe</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>file_exists</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <simpara> - Returns &true; if the file specified by - <parameter>filename</parameter> exists; &false; otherwise. + Retorna &true; se o arquivo expecificado por + <parameter>nomedoarquivo</parameter> existe; &false; caso contrário. </simpara> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não irá funcionar em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + para ser examinado tem que ser accessivel pelo filesystem do servidor. </simpara> <simpara> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados no cache. Veja + <function>clearstatcache</function> para mais detalhes. </simpara> </refsect1> </refentry> @@ -767,38 +766,40 @@ <refentry id="function.fileatime"> <refnamediv> <refname>fileatime</refname> - <refpurpose>Gets last access time of file</refpurpose> + <refpurpose>Obtém o último tempo de acesso do arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fileatime</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <simpara> + Retorna o tempo que o arquivo foi acessado por último, ou &false; + em caso de erro. O tempo que é retornado é um timestamp UNIX. Returns the time the file was last accessed, or &false; in case of an error. The time is returned as a Unix timestamp. </simpara> <simpara> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </simpara> <simpara> - Note: The atime of a file is supposed to change whenever - the data blocks of a file are being read. This can be - costly performancewise when an application regularly - accesses a very large number of files or directories. Some - Unix filesystems can be mounted with atime updates disabled - to increase the performance of such applications; USENET - news spools are a common example. On such filesystems - this function will be useless. - </simpara> - <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Nota: O atime do arquivo deve mudar para quando os blocos + de informação do arquivo são lidos. Isto pode ser caro + em termos de performance quando uma aplicação frequentemente + acessa um numero muito grande de arquivos ou diretórios. + Alguns filesystems Unix podem ser montados com updates dos + atimes desabilitados para aumentar a performance destas + aplicações; USENET news spools é um exemplo comum. Nestes + filesystems esta função é inútil. + </simpara> + <simpara> + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + a ser examinado tem que ser acessível pelo filesystem do servidor. </simpara> </refsect1> </refentry> @@ -806,41 +807,44 @@ <refentry id="function.filectime"> <refnamediv> <refname>filectime</refname> - <refpurpose>Gets inode change time of file</refpurpose> + <refpurpose>Ler o tempo de modificação do inode do arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>filectime</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns the time the file was last changed, or &false; in case of - an error. The time is returned as a Unix timestamp. + Retorna o tempo em que o arquivo foi modificado pela última vez, + ou &false; em caso de erro. O tempo é retornado como um timestamp + Unix. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <para> - Note: In most Unix filesystems, a file is considered - changed when its inode data is changed; that is, when - the permissions, owner, group, or other metadata - from the inode is updated. See also - <function>filemtime</function> (which is what you want to use - when you want to create "Last Modified" footers on web pages) and - <function>fileatime</function>. - </para> - <para>Note also that in some Unix texts the ctime of a file is - referred to as being the creation time of the file. This is wrong. - There is no creation time for Unix files in most Unix filesystems. + Nota: Na maior parte dos filesystems Unix, um arquivo é + considerado modificado quando a informação do inode é + modificada; isto é, quando as permissões, dono (owner), + grupo (group), ou outra metadata do inode é modificada. + Veja também <function>filemtime</function> (o que é o que + você deseja usar quando criando rodapés com informações + sobre última vez que o arquivo foi modificado em web pages) + e <function>fileatime</function>. + </para> + <para>Note também que em alguns textos Unix o ctime do arquivo + é referido como sendo o tempo de criação do tempo do arquivo. + Isto é errado. Não há tempo de criação de arquivos Unix na + maior parte dos filesystems Unix. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não irá funcionar em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + a ser examinado tem que ser acessivel pelo filesystem do servidor. </simpara> </refsect1> </refentry> @@ -848,33 +852,35 @@ <refentry id="function.filegroup"> <refnamediv> <refname>filegroup</refname> - <refpurpose>Gets file group</refpurpose> + <refpurpose>Ler o grupo do arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>filegroup</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> - <para> - Returns the group ID of the owner of the file, or &false; in case - of an error. The group ID is returned in numerical format, use - <function>posix_getgrgid</function> to resolve it to a group name. + <para> + Retorna o group ID do dono do arquivo, ou &false; no caso de um + erro. O group ID é retornado em um formato numérico, use + <function>posix_getgrgid</function> para resolver para o nome do + grupo. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + O resultado desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <note> <simpara> - This function does not work on Windows systems + Esta função não funciona em sistemas Windows </simpara> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não irá funcionar em <link + linkend="features.remote-files">arquivos remotos</link>; o + arquivo a ser examinado tem que ser acessivel atravez do + filesystem do servidor. </simpara> </note> </refsect1> @@ -883,31 +889,32 @@ <refentry id="function.fileinode"> <refnamediv> <refname>fileinode</refname> - <refpurpose>Gets file inode</refpurpose> + <refpurpose>Ler o inode do arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fileinode</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns the inode number of the file, or &false; in case of an - error.</para> + Retorna o numero do inode do arquivo, ou &false; em caso de erro. + </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o + arquivo a ser examinado tem que ser acessivel pelo filesystem + do servidor. </simpara> <note> <simpara> - This function does not work on Windows systems + Esta função não funciona em sistemas Windows </simpara> </note> </refsect1> @@ -916,34 +923,35 @@ <refentry id="function.filemtime"> <refnamediv> <refname>filemtime</refname> - <refpurpose>Gets file modification time</refpurpose> + <refpurpose>Ler o tempo de modificação do arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>filemtime</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns the time the file was last modified, or &false; in case of - an error. The time is returned as a Unix timestamp. + Retorna o tempo em que o arquivo foi modificado pela última vez, ou + &false; em caso de erro. O tempo é retornado como um timestamp Unix. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o + arquivo a ser examinado tem que ser acessivel pelo filesystem + do servidor. </simpara> - <para>Note: This function returns the time when the data - blocks of a file were being written to, that is, the time - when the content of the file was changed. Use - <function>date</function> on the result of this function - to get a printable modification date for use in page footers. + <para>Nota: Esta função retorna o tempo quando os blocos de + informação do arquivo são escritos, isto é, o tempo quando o + conteúdo do arquivo foi mudado. Para obter uma data de + modificação para utilizar em rodapés use a função + <function>date</function>. </para> </refsect1> </refentry> @@ -951,33 +959,34 @@ <refentry id="function.fileowner"> <refnamediv> <refname>fileowner</refname> - <refpurpose>Gets file owner</refpurpose> + <refpurpose>Ler o dono(owner) do arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fileowner</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> - <para> - Returns the user ID of the owner of the file, or &false; in case of - an error. The user ID is returned in numerical format, use - <function>posix_getpwuid</function> to resolve it to a username. + <para> + Retorna o ID do usuário(user ID) do dono(owner) do arquivo, ou &false; + caso um erro ocorra. O ID do usuário é retornado no formato numérico, + use <function>posix_getpwuid</function> para obter o username do + usuário. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + a ser examinado tem que ser acessivel pelo filesystem do servidor. </simpara> <note> <simpara> - This function does not work on Windows systems + Esta função não funciona em sistemas Windows </simpara> </note> </refsect1> @@ -986,27 +995,27 @@ <refentry id="function.fileperms"> <refnamediv> <refname>fileperms</refname> - <refpurpose>Gets file permissions</refpurpose> + <refpurpose>Ler as permissões do arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fileperms</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcprototype> </funcsynopsis> - <para> - Returns the permissions on the file, or &false; in case of an error. + <para> + Retorna as permissões do arquivo, ou &false; em caso de erro. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + a ser examinado tem que ser acessivel pelo filesystem do servidor. </simpara> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> </refsect1> </refentry> @@ -1014,22 +1023,22 @@ <refentry id="function.filesize"> <refnamediv> <refname>filesize</refname> - <refpurpose>Gets file size</refpurpose> + <refpurpose>Ler o tamanho do arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>filesize</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns the size of the file, or &false; in case of an error. + Retorna o tamanho do arquivo, ou &false; em caso de erro. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <simpara> This function will not work on <link @@ -1042,29 +1051,29 @@ <refentry id="function.filetype"> <refnamediv> <refname>filetype</refname> - <refpurpose>Gets file type</refpurpose> + <refpurpose>Ler o tipo de arquivo (file type)</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>string <function>filetype</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> - <para> - Returns the type of the file. Possible values are fifo, char, - dir, block, link, file, and unknown.</para> <para> Returns &false; - if an error occurs. + <para> + Retorna o tipo do arquivo(file type). Valores possiveis são + fifo, char, block, link, file e unknown(desconhecido).</para> + <para> Retorna &false; se um erro ocorrer. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + a ser examinado tem que ser acessivel pelo filesystem do servidor. </simpara> </refsect1> </refentry> @@ -1075,12 +1084,12 @@ <refpurpose>Portable advisory file locking</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>flock</function></funcdef> <paramdef>int <parameter>fp</parameter></paramdef> - <paramdef>int <parameter>operation</parameter></paramdef> + <paramdef>int <parameter>operacao</parameter></paramdef> <paramdef>int <parameter> <optional>wouldblock</optional> @@ -1089,66 +1098,66 @@ </funcprototype> </funcsynopsis> <simpara> - PHP supports a portable way of locking complete files in an - advisory way (which means all accessing programs have to use the - same way of locking or it will not work). + PHP suporta uma maneira portável de lock arquivos completos + em uma advisory way (que significa que todos os programas acessando + tem que usar a mesma maneira de locking ou não irá funcionar). </simpara> <simpara> - <function>flock</function> operates on <parameter>fp</parameter> - which must be an open file - pointer. <parameter>operation</parameter> is one of the following - values: + <function>flock</function> opera em <parameter>fp</parameter>, + que tem que ser um ponteiro de arquivo aberto com sucesso. + <parameter>operacao</parameter> é um dos seguintes valores: </simpara> <para> <itemizedlist> <listitem> <simpara> - To acquire a shared lock (reader), set - <parameter>operation</parameter> to LOCK_SH (set to 1 prior to - PHP 4.0.1). + Para obter uma lock compartilhada (leitura), use + <parameter>operacao</parameter> como LOCK_SH (use 1 se a versão + do PHP for anterior a 4.0.1). </simpara> </listitem> <listitem> <simpara> - To acquire an exclusive lock (writer), set - <parameter>operation</parameter> to LOCK_EX (set to 2 prior to - PHP 4.0.1). + Para obter uma lock exclusiva (gravação), use + <parameter>operacao</parameter> como LOCK_EX (use 2 se a versão + do PHP for anterior a 4.0.1). </simpara> </listitem> <listitem> <simpara> - To release a lock (shared or exclusive), set - <parameter>operation</parameter> to LOCK_UN (set to 3 prior to - PHP 4.0.1). + Para retirar uma lock (compartilhada ou exclusiva), use + <parameter>operacao</parameter> como LOCK_UN (use 3 se a versão + do PHP for anterior a 4.0.1). </simpara> </listitem> <listitem> <simpara> - If you don't want <function>flock</function> to block while - locking, add LOCK_NB (4 prior to PHP 4.0.1) to - <parameter>operation</parameter>. + Se você não quer usar <function>flock</function> para + bloquear enquanto locking, addicione LOCK_NB (3 se a versão + do PHP for anterior a 4.0.1) a <parameter>operacao</parameter>. </simpara> </listitem> </itemizedlist> </para> <simpara> - <function>flock</function> allows you to perform a simple - reader/writer model which can be used on virtually every platform - (including most Unices and even Windows). The optional 3rd - argument is set to &true; if the lock would block (EWOULDBLOCK - errno condition) + <function>flock</function> permite que você possa fazer um simples + modelo leitura/gravação (reader/writer) que pode ser usado em + virtualmente todas as plataformas (incluindo a maior parte dos + Unixes e até mesmo Windows). O terceiro argumento opcional é usado + como &true; se a lock iria bloquear (EWOULDBLOCK errno condition) </simpara> <simpara> - <function>flock</function> returns &true; on success and &false; on - error (e.g. when a lock could not be acquired). + <function>flock</function> retorna &true; em caso de sucesso e + &false; em caso de erro (por exemplo quando uma lock não pode + ser obtida). </simpara> <warning> <para> - On most operation systems <function>flock</function> is implemented - at the process level. When using a multithreaded server API like - ISAPI you cannot rely on <function>flock</function> to protect - files against other PHP scripts running in parallel threads of the - same server instance! + Na maior parte dos sistemas operacionais <function>flock</function> + é implementada no nível do processo. Quando usando um servidor + com um multithreaded API como ISAPI você não pode confiar no + <function>flock</function> para proteger os arquivos contra outros + scripts PHP rodando em threads paralelos do mesmo servidor. </para> </warning> </refsect1> @@ -1157,14 +1166,14 @@ <refentry id="function.fopen"> <refnamediv> <refname>fopen</refname> - <refpurpose>Opens file or URL</refpurpose> + <refpurpose>Abrir um arquivo ou uma URL</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fopen</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> <paramdef>string <parameter>mode</parameter></paramdef> <paramdef>int <parameter> @@ -1174,123 +1183,126 @@ </funcprototype> </funcsynopsis> <simpara> - If <parameter>filename</parameter> begins with "http://" (not - case sensitive), an HTTP 1.0 connection is opened to the - specified server, the page is requested using the HTTP GET - method, and a file pointer is returned to the beginning - of the body of the response. A 'Host:' header is sent with the - request in order to handle name-based virtual hosts. + Se <parameter>nomedoarquivo</parameter> começa com "http://" + (não diferencia entre caracteres maiusculas e minusculas), + uma conexão HTTP 1.0 é aberta para o servidor especificado, a + página é requisitada usando o método HTTP GET, e um ponteiro + de arquivo é retornado no começo do corpo da resposta. O + cabeçalho 'Host:' é enviado com o pedido para que virtual + hosts baseados em nomes sejam suportados. </simpara> <simpara> - Note that the file pointer allows you to retrieve only the - <emphasis>body</emphasis> of the response; you cannot - access the HTTP response header using this function. + Note que o ponteiro de arquivo deixa você retirar somente o + corpo(<emphasis>body</emphasis>) da resposta; você não pode + acessar o cabeçalho de resposta HTTP usando esta função. </simpara> <simpara> - Versions prior to PHP 4.0.5 do not handle HTTP redirects. Because - of this, directories must include trailing slashes. + Versões anteriores a PHP 4.0.5 não suportam redirecionamentos HTTP. + Por causa disso, diretórios devem incluir a barra no final. </simpara> <simpara> - If <parameter>filename</parameter> begins with "ftp://" (not case - sensitive), an ftp connection to the specified server is opened - and a pointer to the requested file is returned. If the server - does not support passive mode ftp, this will fail. You can open - files for either reading or writing via ftp (but not both - simultaneously). + Se <parameter>nomedoarquivo</parameter> começa com "ftp://" (não + diferencia entre caracteres maiusculas e minusculas também), uma + conexão para o servidor especificado é aberta e um ponteiro para o + arquivo perdido é retornado. Se o servidor não suporta modo passivo, + isto irá falhar. Você pode abrir arquivos tanto para leitura quanto + para gravação via ftp (mas não para ambos simultâneamente). </simpara> <simpara> - If <parameter>filename</parameter> is one of "php://stdin", - "php://stdout", or "php://stderr", the corresponding stdio - stream will be opened. (This was introduced in PHP 3.0.13; - in earlier versions, a filename such as "/dev/stdin" or - "/dev/fd/0" must be used to access the stdio streams.) + Se <parameter>nomedoarquivo</parameter> é ou "php://stdin", + ou "php://stdout", ou "php://stderr", o correspondente stream + stdio será aberto. (Isto foi introduziso no PHP 3.0.13; em + versões anteriores, um nome de arquivo como "/dev/stdin" ou + "/dev/fd/0" deve ser usado para acessar os streams stdio.) </simpara> <simpara> - If <parameter>filename</parameter> begins with anything else, the - file will be opened from the filesystem, and a file pointer to - the file opened is returned. + Se <parameter>nomedoarquivo</parameter> começa com qualquer outra + coisa, o arquivo será aberto no filesystem e um ponteiro para o + arquivo será retornado. </simpara> <simpara> - If the open fails, the function returns &false;. + Se a abertura falhar, a função retornará &false;. </simpara> <para> - <parameter>mode</parameter> may be any of the following: + <parameter>mode</parameter> pode ser qualquer um dos seguintes: <itemizedlist> <listitem> <simpara> - 'r' - Open for reading only; place the file pointer at the - beginning of the file. + 'r' - Abrir somente para leitura; coloca o ponteiro de arquivo + no começo do arquivo. </simpara> </listitem> <listitem> <simpara> - 'r+' - Open for reading and writing; place the file pointer at - the beginning of the file. + 'r+' - Abrir para leitura e gravação; colocar o ponteiro de + arquivo no começo do arquivo. </simpara> </listitem> <listitem> <simpara> - 'w' - Open for writing only; place the file pointer at the - beginning of the file and truncate the file to zero length. - If the file does not exist, attempt to create it. + 'w' - Abrir somente para gravação; colocar o ponteiro de + arquivo no começo do arquivo e truncar o arquivo para tamanho + zero. Se o arquivo não existir, tentar cria-lo. </simpara> </listitem> <listitem> <simpara> - 'w+' - Open for reading and writing; place the file pointer at - the beginning of the file and truncate the file to zero - length. If the file does not exist, attempt to create it. + 'w+' - Abrir para leitura e escrita; colocar o ponteiro de + arquivo no início do arquivo e truncar o arquivo para tamanho + zero. Se o arquivo não existir, tentar cria-lo. </simpara> </listitem> <listitem> <simpara> - 'a' - Open for writing only; place the file pointer at the end - of the file. If the file does not exist, attempt to create - it. + 'a' - Abrir o arquivo somente para escrita; colocar o ponteiro + de arquivo no fim do arquivo. Se o arquivo não existe, tentar + cria-lo. </simpara> </listitem> <listitem> <simpara> - 'a+' - Open for reading and writing; place the file pointer at - the end of the file. If the file does not exist, attempt to - create it. + 'a+' - Abrir o arquivo para leitura e gravação; colocar o + ponteiro no fim do arquivo. Se o arquivo não existe, tentar + cria-lo. </simpara> </listitem> </itemizedlist> </para> <note> <para> - The <parameter>mode</parameter> may contain the letter - 'b'. This is useful only on systems which differentiate between - binary and text files (i.e. Windows. It's useless on Unix). - If not needed, this will be ignored. + O <parameter>mode</parameter> pode conter a letra 'b'. Isto é + útil somente em sistemas que diferenciam entre arquivos + binários e texto (por exemplo Windows. É inútil em Unix). + Se não nescessário, será ignorado. </para> </note> <para> - You can use the optional third parameter and set it to "1", if - you want to search for the file in the <link - linkend="ini.include-path">include_path</link>, too. + Você pode usar o terceiro parametro opctional como "1", se você + quer procurar pelo arquivo no <link + linkend="ini.include-path">include_path</link>, também. </para> <para> <example> - <title><function>fopen</function> example</title> + <title>exemplo do <function>fopen</function></title> <programlisting role="php"> -$fp = fopen ("/home/rasmus/file.txt", "r"); -$fp = fopen ("/home/rasmus/file.gif", "wb"); +$fp = fopen ("/home/rasmus/arquivo.txt", "r"); +$fp = fopen ("/home/rasmus/arquivo.gif", "wb"); $fp = fopen ("http://www.php.net/", "r"); -$fp = fopen ("ftp://user:password@example.com/", "w"); +$fp = fopen ("ftp://usuario:senha@exemplo.com.br/", "w"); </programlisting> </example> </para> <simpara> - If you are experiencing problems with reading and writing to - files and you're using the server module version of PHP, remember - to make sure that the files and directories you're using are - accessible to the server process. + Se você está tendo problemas com a leitura e gravação para + arquivos e você está usando a versão de modulo de servidor do + PHP, lembre-se de ter certeza que os arquivos e diretórios que + você está usando precisam ser acessíveis ao processo do servidor + de HTTP. </simpara> <para> - On the Windows platform, be careful to escape any backslashes - used in the path to the file, or use forward slashes. + Na plataforma Windows, tenha cuidado para usar uma segunda + barra invertida (escape) usada no path de um arquivo, ou usar + a barra normal. <informalexample> <programlisting role="php"> $fp = fopen ("c:\\data\\info.txt", "r"); @@ -1298,9 +1310,9 @@ </informalexample> </para> <simpara> - See also <function>fclose</function>, + Veja também <function>fclose</function>, <function>fsockopen</function>, - <function>socket_set_timeout</function>, and + <function>socket_set_timeout</function>, e <function>popen</function>. </simpara> </refsect1> @@ -1310,11 +1322,11 @@ <refnamediv> <refname>fpassthru</refname> <refpurpose> - Output all remaining data on a file pointer + Imprime todo o restante de um ponteiro de arquivo </refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fpassthru</function></funcdef> @@ -1322,28 +1334,28 @@ </funcprototype> </funcsynopsis> <simpara> - Reads to EOF on the given file pointer and writes the results to - standard output. + Lê até o fim do arquivo (EOF) do ponteiro de arquivo dado e + imprime os resultados para a saída normal (standard output). </simpara> <simpara> - If an error occurs, <function>fpassthru</function> returns - &false;. + Se um error ocorrer, a função <function>fpassthru</function> + retorna &false;. </simpara> <simpara> - The file pointer must be valid, and must point to a file - successfully opened by <function>fopen</function>, - <function>popen</function>, or <function>fsockopen</function>. - The file is closed when <function>fpassthru</function> is done - reading it (leaving <parameter>fp</parameter> useless). + O ponteiro de arquivo tem que ser válido e apontar para um + arquivo aberto com sucesso por <function>fopen</function>, + <function>popen</function>, ou <function>fsockopen</function>. + O arquivo é fechado quando <function>fpassthru</function> + acaba de ler (deixando <parameter>fp</parameter> sem utilidade). </simpara> <simpara> - If you just want to dump the contents of a file to stdout you may - want to use the <function>readfile</function>, which saves you - the <function>fopen</function> call. + Se você quiser somente jogar o conteúdo do arquivo para stout você + pode querer usar a função <function>readfile</function>, que vai + salvar a você a chamada a função <function>fopen</function>. </simpara> <simpara> - See also <function>readfile</function>, - <function>fopen</function>, <function>popen</function>, and + Veja também <function>readfile</function>, + <function>fopen</function>, <function>popen</function>, e <function>fsockopen</function> </simpara> </refsect1> @@ -1352,10 +1364,10 @@ <refentry id="function.fputs"> <refnamediv> <refname>fputs</refname> - <refpurpose>Writes to a file pointer</refpurpose> + <refpurpose>Escrever para um ponteiro de arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fputs</function></funcdef> @@ -1363,16 +1375,16 @@ <paramdef>string <parameter>str</parameter></paramdef> <paramdef>int <parameter> - <optional>length</optional> + <optional>comprimento</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> - <function>fputs</function> is an alias to - <function>fwrite</function>, and is identical in every way. Note - that the <parameter>length</parameter> parameter is optional and - if not specified the entire string will be written. + <function>fputs</function> é uma função sinônima (alias) para + <function>fwrite</function>, e é identica em todas as maneiras. + Note que o parametro <parameter>comprimento</parameter> é opcional + e se não for especificado a string inteira será escrita. </para> </refsect1> </refentry> @@ -1380,57 +1392,57 @@ <refentry id="function.fread"> <refnamediv> <refname>fread</refname> - <refpurpose>Binary-safe file read</refpurpose> + <refpurpose>Leitura binary-safe de arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>string <function>fread</function></funcdef> <paramdef>int <parameter>fp</parameter></paramdef> - <paramdef>int <parameter>length</parameter></paramdef> + <paramdef>int <parameter>comprimento</parameter></paramdef> </funcprototype> </funcsynopsis> <simpara> - <function>fread</function> reads up to - <parameter>length</parameter> bytes from the file pointer - referenced by <parameter>fp</parameter>. Reading stops when - <parameter>length</parameter> bytes have been read or EOF is - reached, whichever comes first. + <function>fread</function> lê até + <parameter>comprimento</parameter> bytes. A leitura é + interrompida quando <parameter>comprimento</parameter> + bytes foram lidos ou o fim do arquivo (eof) foi alcançado, + o que ocorrer primeiro. </simpara> <para> <informalexample> <programlisting role="php"> -// get contents of a file into a string -$filename = "/usr/local/something.txt"; -$fd = fopen ($filename, "r"); -$contents = fread ($fd, filesize ($filename)); +// ler o conteúdo do arquivo para uma string +$nomedoarquivo = "/usr/local/algo.txt"; +$fd = fopen ($nomedoarquivo, "r"); +$conteudo = fread ($fd, filesize ($nomedoarquivo)); fclose ($fd); </programlisting> </informalexample> </para> <note> <para> - On systems which differentiate between binary and text files - (i.e. Windows) the file must be opened with 'b' included in - <function>fopen</function> mode parameter. + Em sistemas que diferenciam entre arquivos binários e texto + (por exemplo Windows) o arquivo tem que ser aberto com 'b' + incluído como parametro na função <function>fopen</function>. </para> </note> <para> <informalexample> <programlisting role="php"> -$filename = "c:\\files\\somepic.gif"; -$fd = fopen ($filename, "rb"); -$contents = fread ($fd, filesize ($filename)); +$nomedoarquivo = "c:\\arquivos\\algumaimg.gif"; +$fd = fopen ($nomedoarquivo, "rb"); +$conteudo = fread ($fd, filesize ($nomedoarquivo)); fclose ($fd); </programlisting> </informalexample> </para> <simpara> - See also <function>fwrite</function>, <function>fopen</function>, + Veja também <function>fwrite</function>, <function>fopen</function>, <function>fsockopen</function>, <function>popen</function>, <function>fgets</function>, <function>fgetss</function>, - <function>fscanf</function>, <function>file</function>, and + <function>fscanf</function>, <function>file</function>, e <function>fpassthru</function>. </simpara> </refsect1> @@ -1439,37 +1451,37 @@ <refentry id="function.fscanf"> <refnamediv> <refname>fscanf</refname> - <refpurpose>Parses input from a file according to a format</refpurpose> + <refpurpose>Parses a entrada de um arquivo de acordo com um formato</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>mixed <function>fscanf</function></funcdef> <paramdef>int <parameter>handle</parameter></paramdef> - <paramdef>string <parameter>format</parameter></paramdef> + <paramdef>string <parameter>formato</parameter></paramdef> <paramdef>string <parameter><optional>var1</optional></parameter>... </paramdef> </funcprototype> </funcsynopsis> <para> - The function <function>fscanf</function> is similar to - <function>sscanf</function>, but it takes its input from a file - associated with <parameter>handle</parameter> and interprets the - input according to the specified - <parameter>format</parameter>. If only two parameters were passed - to this function, the values parsed will be returned as an array. - Otherwise, if optional parameters are passed, the function will - return the number of assigned values. The optional parameters - must be passed by reference. + A função <function>fscanf</function> é semelhante a + <function>sscanf</function>, mas usa como entrada um arquivo + associado com <parameter>handle</parameter> e interpreta a + entrada de acordo com o <parameter>formato</parameter> + especificado. Se somente dois parametros forem passados a esta + função, os valores parsed serão retornados como um array. + De outro modo, se parametros opcionais são passados a função + irá retornar o número de valores utilizados. Os parametros opcionais + tem que ser passados por referência. <example> - <title><function>fscanf</function> Example</title> + <title>Exemplo do <function>fscanf</function></title> <programlisting role="php"> $fp = fopen ("users.txt","r"); while ($userinfo = fscanf ($fp, "%s\t%s\t%s\n")) { - list ($name, $profession, $countrycode) = $userinfo; - //... do something with the values + list ($name, $profission, $countrycode) = $userinfo; + //... fazer algo com os valores } fclose($fp); </programlisting> @@ -1477,17 +1489,17 @@ <example> <title>users.txt</title> <programlisting> -javier argonaut pe -hiroshi sculptor jp -robert slacker us -luigi florist it +javier argonauta pe +hiroshi escultor jp +robert tradutor us +luigi florista it </programlisting> </example> </para> <para> - See also <function>fread</function>, <function>fgets</function>, + Veja também <function>fread</function>, <function>fgets</function>, <function>fgetss</function>, <function>sscanf</function>, - <function>printf</function>, and <function>sprintf</function>. + <function>printf</function>, e <function>sprintf</function>. </para> </refsect1> </refentry> @@ -1495,10 +1507,10 @@ <refentry id="function.fseek"> <refnamediv> <refname>fseek</refname> - <refpurpose>Seeks on a file pointer</refpurpose> + <refpurpose>Procura (seeks) em um ponteiro de arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fseek</function></funcdef> @@ -1510,40 +1522,41 @@ </funcprototype> </funcsynopsis> <para> - Sets the file position indicator for the file referenced by - <parameter>fp</parameter>.The new position, measured in bytes - from the beginning of the file, is obtained by adding - <parameter>offset</parameter> to the position specified by - <parameter>whence</parameter>, whose values are defined as - follows: + Modifica o indicador de posição do arquivo referenciado por + <parameter>fp</parameter>. A nova posição é obtida, medindo em + bytes do início do arquivo, é obtida ao adicionar + <parameter>offset</parameter> a posição especificada por + <parameter>whence</parameter>, cujo valor é definido como + se segue: <simplelist> - <member>SEEK_SET - Set position equal to - <parameter>offset</parameter> bytes.</member> <member>SEEK_CUR - - Set position to current location plus - <parameter>offset</parameter>.</member> <member>SEEK_END - Set - position to end-of-file plus - <parameter>offset</parameter>.</member> + <member>SEEK_SET - Use a posição igual à <parameter>offset</parameter> + bytes. </member> <member>SEEK_CUR - Use a posição para a + localização atual mais <parameter>offset</parameter>.</member> + <member>SEEK_END - Use a posição para o fim do arquivo (eof) + mais <parameter>offset</parameter>.</member> </simplelist> </para> - <para>If <parameter>whence is not specified, it is assumed to be - SEEK_SET.</parameter> + <para>Se <parameter>whence</parameter> não é especificado é + presumido ser SEEK_SET.</parameter> </para> <para> - Upon success, returns 0; otherwise, returns -1. Note that seeking - past EOF is not considered an error. + Em caso de sucesso, retorna 0; caso contrário, retorna -1. Note + que fazer um seek depois do fim do arquivo (eof) é considerado + um erro. </para> <para> - May not be used on file pointers returned by - <function>fopen</function> if they use the "http://" or "ftp://" - formats. + Não pode ser usado em ponteiros de arquivo retornados por + <function>fopen</function> se for usado o formato "http://" + ou "ftp://". </para> <note> <para> - The <parameter>whence</parameter> argument was added after PHP 4.0 RC1. + O argumento <parameter>whence</parameter> foi adicionado depois do + PHP 4.0 RC1. </para> </note> <para> - See also <function>ftell</function> and + Veja também <function>ftell</function> e <function>rewind</function>. </para> </refsect1> @@ -1553,11 +1566,11 @@ <refnamediv> <refname>fstat</refname> <refpurpose> - Gets information about a file using an open file pointer + Ler a informação sobre um arquivo usando um ponteiro de arquivo aberto </refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>array <function>fstat</function></funcdef> @@ -1565,33 +1578,33 @@ </funcprototype> </funcsynopsis> <para> - Gathers the statistics of the file opened by the file - pointer fp. This function is similar to the - <function>stat</function> function except that it operates - on an open file pointer instead of a filename. + Mantém estatísticas do arquivo aberto pelo ponteiro de + arquivos fp. Esta função é similar a função + <function>stat</function> exceto que ela opera em um + ponteiro de arquivo aberto ao invéz de um nome de arquivo. </para> <para> - Returns an array with the statistics of the file with the - following elements: + Retorna um array com as estatísticas do arquico com os seguintes + elementos: <orderedlist> <listitem><simpara>device</simpara></listitem> <listitem><simpara>inode</simpara></listitem> - <listitem><simpara>number of links</simpara></listitem> - <listitem><simpara>user id of owner</simpara></listitem> - <listitem><simpara>group id owner</simpara></listitem> - <listitem><simpara>device type if inode device *</simpara></listitem> - <listitem><simpara>size in bytes</simpara></listitem> - <listitem><simpara>time of last access</simpara></listitem> - <listitem><simpara>time of last modification</simpara></listitem> - <listitem><simpara>time of last change</simpara></listitem> - <listitem><simpara>blocksize for filesystem I/O *</simpara></listitem> - <listitem><simpara>number of blocks allocated</simpara></listitem> + <listitem><simpara>número de links</simpara></listitem> + <listitem><simpara>user id do dono (owner)</simpara></listitem> + <listitem><simpara>group id (owner)</simpara></listitem> + <listitem><simpara>tipo de device se inode device *</simpara></listitem> + <listitem><simpara>tamanho em bytes</simpara></listitem> + <listitem><simpara>tempo do último acesso</simpara></listitem> + <listitem><simpara>tempo da última modificação(modification)</simpara></listitem> + <listitem><simpara>tempo da última mudança(change)</simpara></listitem> + <listitem><simpara>tamanho do bloco para o filesystem I/O *</simpara></listitem> + <listitem><simpara>número de blocos alocados</simpara></listitem> </orderedlist> - * - only valid on systems supporting the st_blksize type--other - systems (i.e. Windows) return -1</para> + * - somente válido em sistemas suportando o tipo st_blksize--outros + sistemas (por exemplo Windows) retornam -1</para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> </refsect1> </refentry> @@ -1599,10 +1612,10 @@ <refentry id="function.ftell"> <refnamediv> <refname>ftell</refname> - <refpurpose>Tells file pointer read/write position</refpurpose> + <refpurpose>Diz ao ponteiro de arquivo a posição de leitura/gravação</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ftell</function></funcdef> @@ -1610,20 +1623,20 @@ </funcprototype> </funcsynopsis> <para> - Returns the position of the file pointer referenced by fp; i.e., - its offset into the file stream. + Retorna a posição do ponteiro de arquivo referenciado por fp; por + exemplo o seu offset no file stream. </para> <para> - If an error occurs, returns &false;. + Se um error ocorrer, retorna &false;. </para> <para> - The file pointer must be valid, and must point to a file - successfully opened by <function>fopen</function> or + O ponteiro de arquivo tem que ser válidoe apontar para um + arquivo aberto com sucesso por <function>fopen</function> ou <function>popen</function>. </para> <para> - See also <function>fopen</function>, <function>popen</function>, - <function>fseek</function> and <function>rewind</function>. + Veja também <function>fopen</function>, <function>popen</function>, + <function>fseek</function> e <function>rewind</function>. </para> </refsect1> </refentry> @@ -1632,21 +1645,25 @@ <refnamediv> <refname>ftruncate</refname> <refpurpose> - Truncates a file to a given length. + Corta um arquivo para um tamanho especificado. </refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ftruncate</function></funcdef> <paramdef>int <parameter>fp</parameter></paramdef> - <paramdef>int <parameter>size</parameter></paramdef> + <paramdef>int <parameter>comprimento</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Takes the filepointer, fp, and truncates the file to length, size. - This function returns &true; on success and &false; on failure. + Pega o ponteiro de arquivo, fp, e corta o arquivo no comprimento + especificado. O arquivo final terá os + <paramenter>comprimento</parameter> bytes iniciais idênticos ao + arquivo original. + Esta função retorna &true; em caso de sucesso e &false; em caso + de falha. </para> </refsect1> </refentry> @@ -1654,10 +1671,10 @@ <refentry id="function.fwrite"> <refnamediv> <refname>fwrite</refname> - <refpurpose>Binary-safe file write</refpurpose> + <refpurpose>Gravação em arquivos binary-safe</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fwrite</function></funcdef> @@ -1665,37 +1682,37 @@ <paramdef>string <parameter>string</parameter></paramdef> <paramdef>int <parameter> - <optional>length</optional> + <optional>comprimento</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <simpara> - <function>fwrite</function> writes the contents of - <parameter>string</parameter> to the file stream pointed to by - <parameter>fp</parameter>. If the <parameter>length</parameter> - argument is given, writing will stop after - <parameter>length</parameter> bytes have been written or the end - of <parameter>string</parameter> is reached, whichever comes - first. + <function>fwrite</function> grava os conteúdos de + <parameter>string</parameter> para o stream de arquivo apontado + por <parameter>fp</parameter>. Se o argumento + <parameter>comprimento</parameter> é dado, a gravação irá parar + depois de que <parameter>comprimento</parameter> bytes foram + escritos ou o fim da <parameter>string</parameter> é alcançada, + o que ocorrer primeiro. </simpara> <simpara> - Note that if the <parameter>length</parameter> argument is given, - then the <link + Note que se o argumento <parameter>comprimento</parameter> é dado, + então a opção de configuração <link linkend="ini.magic-quotes-runtime">magic_quotes_runtime</link> - configuration option will be ignored and no slashes will be - stripped from <parameter>string</parameter>. + será ignorada e nenhuma barra será retirada do + <parameter>string</parameter>. </simpara> <note> <para> - On systems which differentiate between binary and text files - (i.e. Windows) the file must be opened with 'b' included in - <function>fopen</function> mode parameter. + Em sistemas que diferenciam entre arquivos binários e texto + (por exemplo Windows) o arquivo tem que ser aberto com 'b' + incluído no parametro mode do <function>fopen</function>. </para> </note> <simpara> - See also <function>fread</function>, <function>fopen</function>, - <function>fsockopen</function>, <function>popen</function>, and + Veja também <function>fread</function>, <function>fopen</function>, + <function>fsockopen</function>, <function>popen</function> e <function>fputs</function>. </simpara> </refsect1> @@ -1705,11 +1722,11 @@ <refnamediv> <refname>set_file_buffer</refname> <refpurpose> - Sets file buffering on the given file pointer + Configura o buffer de um ponteiro de arquivo </refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>set_file_buffer</function></funcdef> @@ -1718,31 +1735,34 @@ </funcprototype> </funcsynopsis> <simpara> - Output using <function>fwrite</function> is normally buffered at - 8K. This means that if there are two processess wanting to write - to the same output stream (a file), each is paused after 8K of - data to allow the other to write. <function>set_file_buffer</function> - sets the buffering for write operations on the given filepointer - <parameter>fp</parameter> to <parameter>buffer</parameter> bytes. - If <parameter>buffer</parameter> is 0 then write operations are - unbuffered. This ensures that all writes with - <function>fwrite</function> are completed before other processes - are allowed to write to that output stream. - </simpara> - <simpara> - The function returns 0 on success, or EOF if the request cannot - be honored. - </simpara> - <para> - The following example demonstrates how to use - <function>set_file_buffer</function> to create an unbuffered stream. + A saída usando <function>fwrite</function> é normalmente + guardada em um buffer de 8K. Isto significa que se se tem + dois processos querendo gravar no mesmo stream de saída (output) + (um arquivo), cada um é pausado depois de 8K de informações para + deixar o outro processo escrever. <function>set_file_buffer</function> + configura o buffer para operações de escrita no dado ponteiro de + arquivo <parameter>fp</parameter> para o <parameter>buffer</parameter> + em bytes. Se <parameter>buffer</parameter> é 0 então as operações + de escrita não utilizarão o buffer. Isso garante que todas + as gravações com <function>fwrite</function> são completadas + antes que outros processos são possibilitados de escreverem + para este stream de saída. + </simpara> + <simpara> + Esta função retorna 0 em caso de sucesso, ou fim do arquivo (eof) + se o pedido não puder ser honrado. + </simpara> + <para> + O seguinte exemplo demonstra como usar + <function>set_file_buffer</function> para criar um stream + sem usar o buffer. <example> - <title><function>set_file_buffer</function> example</title> + <title>exemplo de <function>set_file_buffer</function></title> <programlisting role="php"> -$fp=fopen($file, "w"); +$fp=fopen($arquivo, "w"); if($fp){ set_file_buffer($fp, 0); - fputs($fp, $output); + fputs($fp, $saida); fclose($fp); } </programlisting> @@ -1750,7 +1770,7 @@ </para> <simpara> - See also <function>fopen</function>, <function>fwrite</function>. + Veja também <function>fopen</function> e <function>fwrite</function>. </simpara> </refsect1> </refentry> @@ -1758,30 +1778,30 @@ <refentry id="function.is-dir"> <refnamediv> <refname>is_dir</refname> - <refpurpose>Tells whether the filename is a directory</refpurpose> + <refpurpose>Diz se o arquivo é um diretório</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>is_dir</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedorarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns &true; if the filename exists and is a directory. + Retorna &true; se o nomedoarquivo existe e é um diretório. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. + Veja <function>clearstatcache</function> para mais detalhes. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + a ser examinado tem que ser acessível pelo filesystem do servidor. </simpara> <para> - See also <function>is_file</function> and + Veja também <function>is_file</function> e <function>is_link</function>. </para> </refsect1> @@ -1790,30 +1810,30 @@ <refentry id="function.is-executable"> <refnamediv> <refname>is_executable</refname> - <refpurpose>Tells whether the filename is executable</refpurpose> + <refpurpose>Diz se um arquivo é executável</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>is_executable</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns &true; if the filename exists and is executable. + Retorna &true; se no nomedoarquivo existe e é executável. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + a ser examinado tem que ser acessivel pelo filesystem do servidor. </simpara> <para> - See also <function>is_file</function> and + Veja também <function>is_file</function> e <function>is_link</function>. </para> </refsect1> @@ -1823,26 +1843,26 @@ <refnamediv> <refname>is_file</refname> <refpurpose> - Tells whether the filename is a regular file + Diz se o arquivo é um arquivo comum </refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>is_file</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns &true; if the filename exists and is a regular file. + Retorna &true; se o nome do nomedoarquivo existe e é um arquivo comum. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <para> - See also <function>is_dir</function> and + Veja também <function>is_dir</function> e <function>is_link</function>. </para> </refsect1> @@ -1852,36 +1872,37 @@ <refnamediv> <refname>is_link</refname> <refpurpose> - Tells whether the filename is a symbolic link + Diz se o arquivo é um link simbólico (symbolic link) </refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>is_link</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>arquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns &true; if the filename exists and is a symbolic link. + Retorna &true; se o nomedoarquivo existe e é um link simbólico + (symbolic link). </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <para> - See also <function>is_dir</function> and + Veja também <function>is_dir</function> e <function>is_file</function>. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + a ser examinado tem que ser acessivel pelo filesystem do servidor. </simpara> <note> <simpara> - This function does not work on Windows systems + Esta função não funciona em sistemas Windows </simpara> </note> </refsect1> @@ -1891,36 +1912,36 @@ <refnamediv> <refname>is_readable</refname> <refpurpose> - Tells whether the filename is readable + Diz se o arquivo é legivel (readable) </refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>is_readable</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns &true; if the filename exists and is readable. + Retorna &true; se o nomedoraquivo existe e é legível (readable). </para> <para> - Keep in mind that PHP may be accessing the file as the user - id that the web server runs as (often 'nobody'). Safe mode - limitations are not taken into account. + Lembre-se que o PHP deve estar acessando o arquivo como o mesmo + usuário que o servidor de web roda (frequentemente 'nobody'). + Limitações do safemode não são levadas em consideração. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + a ser examinado tem que ser acessivel pelo filesystem do servidor. </simpara> <para> - See also <function>is_writable</function>. + Veja também <function>is_writable</function>. </para> </refsect1> </refentry> @@ -1928,37 +1949,37 @@ <refentry id="function.is-writable"> <refnamediv> <refname>is_writable</refname> - <refpurpose>Tells whether the filename is writable</refpurpose> + <refpurpose>Diz se pode-se escrever para o arquivo(writable)</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>is_writable</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>arquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Returns &true; if the filename exists and is writable. The - filename argument may be a directory name allowing you to check - if a directory is writeable. + Retorna &true; se o nomedoarquivo existe e pode ser escrito para. + O argumento nomedoarquivo pode ser um nome de diretório, deixando + você saber se o diretório pode ser escrito para (writeable). </para> <para> - Keep in mind that PHP may be accessing the file as the user id - that the web server runs as (often 'nobody'). Safe mode - limitations are not taken into account. + Lembre-se que o PHP deve estar acessando o arquivo como o mesmo + usuário que o servidor de web roda (frequentemente 'nobody'). + Limitações do safemode não são levadas em consideração. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> <simpara> - This function will not work on <link - linkend="features.remote-files">remote files</link>; the file to - be examined must be accessible via the server's filesystem. + Esta função não funcionará em <link + linkend="features.remote-files">arquivos remotos</link>; o arquivo + a ser examinado tem que ser acessível pelo filesystem do servidor. </simpara> <para> - See also <function>is_readable</function>. + Veja também <function>is_readable</function>. </para> </refsect1> </refentry> @@ -1966,18 +1987,19 @@ <refentry id="function.is-writeable"> <refnamediv> <refname>is_writeable</refname> - <refpurpose>Tells whether the filename is writable</refpurpose> + <refpurpose>Diz se pode-se escrever para o arquivo(writable)</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>is_writeable</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - This is an alias for <function>is_writable</function> + Esta é uma função sinônima (alias) para + <function>is_writable</function> </para> </refsect1> </refentry> @@ -1985,41 +2007,41 @@ <refentry id="function.is-uploaded-file"> <refnamediv> <refname>is_uploaded_file</refname> - <refpurpose>Tells whether the file was uploaded via HTTP POST.</refpurpose> + <refpurpose>Diz se o arquivo foi uploaded via HTTP POST</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>is_uploaded_file</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - This function is available only in versions of PHP 3 after PHP - 3.0.16, and in versions of PHP 4 after 4.0.2. + Esta função é somente disponível em versões do PHP3 depois de + 3.0.16, e em versões do PHP 4 depois de 4.0.2. </para> <para> - Returns &true; if the file named by <varname>filename</varname> was - uploaded via HTTP POST. This is useful to help ensure that a - malicious user hasn't tried to trick the script into working on - files upon which it should not be working--for instance, + Retorna &truel se o arquivo com o nome <varname>nomedoarquivo</varname> + foi uploaded via HTTP POST. Isto é útil para ter certeza que um + usuário malicioso, não está tentando confundir o script em trabalhar + em arquivos que não deve estar trabalhando--por exemplo, <filename>/etc/passwd</filename>. </para> <para> - This sort of check is especially important if there is any chance - that anything done with uploaded files could reveal their - contents to the user, or even to other users on the same - system. + Este tipo de confirmação é importante principalmente se existe + alguma chance que qualquer coisa feita com os arquivos uploadeados + poderiam revelar o seu conteúdo para o usuário, ou mesmo + para outros usuários no mesmo sistema. </para> <para> - See also <function>move_uploaded_file</function>, and the section + Veja também <function>move_uploaded_file</function>, e a seção <link linkend="features.file-upload">Handling file uploads</link> - for a simple usage example. + para um simples exemplo de utilização desta função. </para> </refsect1> </refentry> @@ -2027,27 +2049,27 @@ <refentry id="function.link"> <refnamediv> <refname>link</refname> - <refpurpose>Create a hard link</refpurpose> + <refpurpose>Criando um hard link</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>link</function></funcdef> - <paramdef>string <parameter>target</parameter></paramdef> + <paramdef>string <parameter>alvo</parameter></paramdef> <paramdef>string <parameter>link</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - <function>link</function> creates a hard link.</para> + <function>link</function> cria um hard link.</para> <para> - See also the <function>symlink</function> to create soft links, - and <function>readlink</function> along with + Veja também <function>symlink</function> para criar soft links, + e <function>readlink</function> assim como <function>linkinfo</function>. </para> <note> <simpara> - This function does not work on Windows systems + Esta função não funciona em sistemas Windows </simpara> </note> </refsect1> @@ -2056,10 +2078,10 @@ <refentry id="function.linkinfo"> <refnamediv> <refname>linkinfo</refname> - <refpurpose>Gets information about a link</refpurpose> + <refpurpose>Ler informações sobre um link</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>linkinfo</function></funcdef> @@ -2067,20 +2089,20 @@ </funcprototype> </funcsynopsis> <para> - <function>linkinfo</function> returns the st_dev field of the - UNIX C stat structure returned by the lstat system call. This - function is used to verify if a link (pointed to by - <parameter>path</parameter>) really exists (using the same method - as the S_ISLNK macro defined in stat.h). Returns 0 or &false; in - case of error. + <function>linkinfo</function> retorna o campo st_dev da + structure em C do UNIX retornado pela chamada do sistema + (system call) lstat. Esta função é usada para verificar + se um link (apontado por <parameter>path</parameter>) + realmente existe (usando o mesmo metodo que a macro S_ISLNK + definida em stat.h). Retorna 0 ou &false; em caso de erro. </para> <para> - See also <function>symlink</function>, <function>link</function>, - and <function>readlink</function>. + Veja também <function>symlink</function>, <function>link</function>, + e <function>readlink</function>. </para> <note> <simpara> - This function does not work on Windows systems + Esta função não funciona em sistemas Windows </simpara> </note> </refsect1> @@ -2089,36 +2111,37 @@ <refentry id="function.mkdir"> <refnamediv> <refname>mkdir</refname> - <refpurpose>Makes directory</refpurpose> + <refpurpose>Criar um diretório</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>mkdir</function></funcdef> - <paramdef>string <parameter>pathname</parameter></paramdef> + <paramdef>string <parameter>nomedopath</parameter></paramdef> <paramdef>int <parameter>mode</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Attempts to create the directory specified by pathname. + Tenta criar o diretório especificado por + <parameter>nomedopath</parameter>. </para> <para> - Note that you probably want to specify the mode as an - octal number, which means it should have a leading zero. - The mode is also modified by the current umask, which you - can change using <function>umask</function>. + Note que você provavelmente quer especificar o mode como + um número octal, o que significa que ele deve ter o zero + inicial. O mode é também modificado pela umaks atual, + o que você pode mudar usando <function>umask</function>. <informalexample> <programlisting role="php"> -mkdir ("/path/to/my/dir", 0700); +mkdir ("/path/para/o/meu/dir", 0700); </programlisting> </informalexample> </para> <para> - Returns &true; on success and &false; on failure. + Retorna &true; em sucesso e &false; em caso de falha. </para> <para> - See also <function>rmdir</function>. + Veja também <function>rmdir</function>. </para> </refsect1> </refentry> @@ -2126,58 +2149,58 @@ <refentry id="function.move-uploaded-file"> <refnamediv> <refname>move_uploaded_file</refname> - <refpurpose>Moves an uploaded file to a new location.</refpurpose> + <refpurpose>Move um arquivo uploadeado para uma nova localização</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>move_uploaded_file</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> - <paramdef>string <parameter>destination</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> + <paramdef>string <parameter>destino</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - This function is available only in versions of PHP 3 after PHP - 3.0.16, and in versions of PHP 4 after 4.0.2. + Esta função está disponível somente em versões do PHP 3 depois + da 3.0.16, e em versões do PHP 4 depois da 4.0.2. </para> <para> - This function checks to ensure that the file designated by - <parameter>filename</parameter> is a valid upload file (meaning - that it was uploaded via PHP's HTTP POST upload mechanism). If - the file is valid, it will be moved to the filename given by - <parameter>destination</parameter>. + Esta função checa para ter certeza que o arquivo designado por + <parameter>nomedoarquivo</parameter> é um arquivo válido + uploadeado (significando que ele foi uploadeado pelo mecanismo + do PHP de HTTP POST). Se o arquivo é válido, ele será movido + para o nomedoarquivo dado pelo <parameter>destino</parameter>. </para> <para> - If <parameter>filename</parameter> is not a valid upload file, - then no action will occur, and - <function>move_uploaded_file</function> will return + Se <parameter>nomedoarquivo</parameter> não é um arquivo + uploadeado válido, então não haverá nenhuma ação e + <function>move_uploaded_file</function> irá retornar &false;. &false;. </para> <para> - If <parameter>filename</parameter> is a valid upload file, but - cannot be moved for some reason, no action will occur, and - <function>move_uploaded_file</function> will return - &false;. Additionally, a warning will be issued. + Se <parameter>nomedoarquivo</parameter> é um arquivo uploadeado + válido e não pode ser movido por alguma razão, nenhuma ação + irá ocorrer, e <function>move_uploaded_file</function> irá + retornar &false;. Adicionalmente, um aviso será transmitido. </para> <para> - This sort of check is especially important if there is any chance - that anything done with uploaded files could reveal their - contents to the user, or even to other users on the same - system. + Este tipo de confirmação é importante principalmente se existe + alguma chance que qualquer coisa feita com os arquivos uploadeados + poderiam revelar o seu conteúdo para o usuário, ou mesmo + para outros usuários no mesmo sistema. </para> ¬e.sm.uidcheck; <para> - See also <function>is_uploaded_file</function>, and the section + Veja também <function>is_uploaded_file</function>, e a seção <link linkend="features.file-upload">Handling file uploads</link> - for a simple usage example. + para um simples exemplo de utilização desta função. </para> </refsect1> </refentry> @@ -2185,71 +2208,73 @@ <refentry id="function.parse-ini-file"> <refnamediv> <refname>parse_ini_file</refname> - <refpurpose>Parse a configuration file</refpurpose> + <refpurpose>Parse um arquivo de configuração</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>array <function>parse_ini_file</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> <paramdef>bool <parameter> - <optional>process_sections</optional> + <optional>processar_secoes</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <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; + <function>parse_ini_file</function> carrega no + arquivo ini especificado no + <parameter>nomedoarquivo</parameter>, e retorna as + configurações dele em um array associativo. + Ao usar <parameter>processar_secoes</parameter> como + &true;, você receberá um array multidimensional, com + os nomes das seções e os parametros incluidos. O + padrão (default) para + <parameter>processar_secoes</parameter> é &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. + Esta função não tem nada a ver com o arquivo + <filename>php.ini</filename>. Este já é processado na hora + que você executa o script. Esta função pode ser usada para ler + os arquivos de configuração de sua própria aplicação. </para> </note> <para> - The structure of the ini file is similar to that of - the <filename>php.ini</filename>'s. + A estrutura do arquivo ini é similar a do + <filename>php.ini</filename>. </para> <para> <example> - <title>Contents of sample.ini</title> + <title>Conteúdo de exemplo.ini</title> <programlisting> -; This is a sample configuration file -; Comments start with ';', as in php.ini +; Este é um arquivo de configuração de exemplo +; Comentário começam com ';', como no php.ini -[first_section] -one = 1 -five = 5 +[primeira_secao] +um = 1 +cinco = 5 -[second_section] +[segunda_secao] path = /usr/local/bin </programlisting> </example> </para> <para> <example> - <title><function>parse_ini_file</function> example</title> + <title>exemplo de <function>parse_ini_file</function></title> <programlisting> <![CDATA[ <?php -// Parse without sections -$ini_array = parse_ini_file("sample.ini"); +// Parse sem as seções +$ini_array = parse_ini_file("exemplo.ini"); print_r($ini_array); -// Parse with sections -$ini_array = parse_ini_file("sample.ini", TRUE); +// Parse com as seções +$ini_array = parse_ini_file("exemplo.ini", TRUE); print_r($ini_array); ?> @@ -2263,19 +2288,19 @@ <programlisting> Array ( - [one] => 1 - [five] => 5 + [um] => 1 + [cinco] => 5 [path] => /usr/local/bin ) Array ( - [first_section] => Array + [primeira_secao] => Array ( - [one] => 1 - [five] => 5 + [um] => 1 + [cinco] => 5 ) - [second_section] => Array + [segunda_secao] => Array ( [path] => /usr/local/bin ) @@ -2290,10 +2315,10 @@ <refentry id="function.pathinfo"> <refnamediv> <refname>pathinfo</refname> - <refpurpose>Returns information about a file path</refpurpose> + <refpurpose>Retorna informação sobre o path de um arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>array <function>pathinfo</function></funcdef> @@ -2301,30 +2326,30 @@ </funcprototype> </funcsynopsis> <para> - <function>pathinfo</function> returns an associative array - containing information about <parameter>path</parameter>. The - following array elements are returned: + <function>pathinfo</function> retorna um array associatico + contendo informações sobre o <parameter>path</parameter>. O + seguinte elementos do array são retornados: <parameter>dirname</parameter>, <parameter>basename</parameter> - and <parameter>extension</parameter>. + e <parameter>extension</parameter>. </para> <para> <example> - <title><function>pathinfo</function> Example</title> + <title>Exemplo de <function>pathinfo</function></title> <programlisting role="php"> <?php -$path_parts = pathinfo("/www/htdocs/index.html"); +$partes_do_path = pathinfo("/www/htdocs/index.html"); -echo $path_parts["dirname"] . "\n"; -echo $path_parts["basename"] . "\n"; -echo $path_parts["extension"] . "\n"; +echo $partes_do_path["dirname"] . "\n"; +echo $partes_do_path["basename"] . "\n"; +echo $partes_do_path["extension"] . "\n"; ?> </programlisting> </example> </para> <para> - Would produce: + Produziria: <informalexample> <programlisting> /www/htdocs @@ -2334,9 +2359,9 @@ </informalexample> </para> <para> - See also <function>dirname</function>, + Veja também <function>dirname</function>, <function>basename</function>, <function>parse_url</function> - and <function>realpath</function>. + e <function>realpath</function>. </para> </refsect1> </refentry> @@ -2344,10 +2369,10 @@ <refentry id="function.pclose"> <refnamediv> <refname>pclose</refname> - <refpurpose>Closes process file pointer</refpurpose> + <refpurpose>Fechar um processo de um ponteiro de arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>pclose</function></funcdef> @@ -2355,19 +2380,18 @@ </funcprototype> </funcsynopsis> <para> - Closes a file pointer to a pipe opened by + Fecha um ponteiro de arquivo a uma pipe aberta por <function>popen</function>. </para> - <para> - The file pointer must be valid, and must have been returned by a - successful call to <function>popen</function>. + <para> + O ponteiro de arquivo tem que ser válido e tem que ser retornado + por uma chamada bem sucedida a função <function>popen</function>. </para> <para> - Returns the termination status of the process that was - run. + Retorna o status da terminação do processo que rodava. </para> <para> - See also <function>popen</function>. + Veja também <function>popen</function>. </para> </refsect1> </refentry> @@ -2375,10 +2399,10 @@ <refentry id="function.popen"> <refnamediv> <refname>popen</refname> - <refpurpose>Opens process file pointer</refpurpose> + <refpurpose>Abrir um processo de ponteiro de arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>popen</function></funcdef> @@ -2387,19 +2411,19 @@ </funcprototype> </funcsynopsis> <para> - Opens a pipe to a process executed by forking the command given - by command. + Abre uma pipe para um processo executado ao se dar um fork + para o comando dado por command. </para> - <para> - Returns a file pointer identical to that returned by - <function>fopen</function>, except that it is unidirectional (may - only be used for reading or writing) and must be closed with - <function>pclose</function>. This pointer may be used with - <function>fgets</function>, <function>fgetss</function>, and + <para> + Retorna um ponteiro de arquivo identico ao retornado por + <function>fopen</function>, exceto que ele é unidirecional + (somente pode ser usado para leitura ou gravação) e tem que ser + fechado com pclose. Este ponteiro pode ser usado com + <function>fgets</function>, <function>fgetss</function> e <function>fputs</function>. </para> <para> - If an error occurs, returns &false;. + Caso um erro ocorra retorna &false;. </para> <para> <informalexample> @@ -2409,7 +2433,7 @@ </informalexample> </para> <para> - See also <function>pclose</function>. + Veja também <function>pclose</function>. </para> </refsect1> </refentry> @@ -2417,14 +2441,14 @@ <refentry id="function.readfile"> <refnamediv> <refname>readfile</refname> - <refpurpose>Outputs a file</refpurpose> + <refpurpose>Ler o conteúdo de um arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>readfile</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> <paramdef>int <parameter> <optional>use_include_path</optional> @@ -2433,43 +2457,47 @@ </funcprototype> </funcsynopsis> <para> - Reads a file and writes it to standard output. + Lê um arquivo e escreve o seu conteúdo para a saída padrão + (standard output). </para> <para> - Returns the number of bytes read from the file. If an error - occurs, &false; is returned and unless the function was called as - @readfile, an error message is printed. + Retorna o número de bytes lido do arquivo. Se um error ocorrer, + retorna &false; e ao menos que a função seja chamada como + @readfile, uma mensagem de erro será impressa. </para> <para> - If <parameter>filename</parameter> begins with "http://" - (not case sensitive), an HTTP 1.0 connection is opened to the - specified server and the text of the response is written to - standard output. + Se <parameter>nomedoarquivo</parameter> comeca com "http://" + (não diferencia entre maiúsculas e mínusculas), uma conexão + HTTP 1.0 será aberta para o servidor específicado e o texto + da resposta será escrito para a saída padrão (standard output). </para> <para> - Versions prior to PHP 4.0.5 do not handle HTTP redirects. Because - of this, directories must include trailing slashes. + Versões anteriores a PHP 4.0.5 não comportam redirecionamento de + HTTP. Por causa disto, diretórios tem que incluir a barra ao fim. </para> <para> - If <parameter>filename</parameter> begins with "ftp://" - (not case sensitive), an ftp connection to the specified server is - opened and the requested file is written to standard output. If the server - does not support passive mode ftp, this will fail. + Se <parameter>nomedoarquivo</parameter> começa com "ftp://" + (não diferencia entre maiúsculas e mínusculas), uma conexão + para o servidor especificado é aberta e o arquivo requisitado é + escrito e o arquivo requisitado é escrito para a saída padrão + (standard output). Se o servidor não suporta modo passivo, ista + conexão irá falhar. </para> <para> - If <parameter>filename</parameter> begins with neither - of these strings, the file will be opened from the filesystem and - its contents written to standard output. + Se o <parameter>nomedoarquivo</parameter> não começar com nenhuma + das duas strings acima, o arquivo será aberto do filesystem e + o seu conteúdo escrito para a saída padrão (standard output). </para> <para> - You can use the optional second parameter and set it to "1", if - you want to search for the file in the <link + Você pode usar o segundo parametro opcional e o setar para "1", + se você quiser procurar o arquivo no <link + linkend="ini.include-path">include_path</link>, também. linkend="ini.include-path">include_path</link>, too. </para> <para> - See also <function>fpassthru</function>, + Veja também <function>fpassthru</function>, <function>file</function>, <function>fopen</function>, - <function>include</function>, <function>require</function>, and + <function>include</function>, <function>require</function> e <function>virtual</function>. </para> </refsect1> @@ -2478,10 +2506,10 @@ <refentry id="function.readlink"> <refnamediv> <refname>readlink</refname> - <refpurpose>Returns the target of a symbolic link</refpurpose> + <refpurpose>Retornar o alvo de um link simbólico</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>string <function>readlink</function></funcdef> @@ -2489,18 +2517,18 @@ </funcprototype> </funcsynopsis> <para> - <function>readlink</function> does the same as the readlink C - function and returns the contents of the symbolic link path or 0 - in case of error. + <function>readlink</function> faz o mesmo que a função do C + readlink e retorna os conteúdos do path do link simbólico ou + 0 em caso de erro. </para> <para> - See also <function>symlink</function>, - <function>readlink</function> and + Veja também <function>symlink</function>, + <function>readlink</function> e <function>linkinfo</function>. </para> <note> <simpara> - This function does not work on Windows systems + Esta função não funciona em sistemas Windows </simpara> </note> </refsect1> @@ -2509,23 +2537,23 @@ <refentry id="function.rename"> <refnamediv> <refname>rename</refname> - <refpurpose>Renames a file</refpurpose> + <refpurpose>Renomear um arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>rename</function></funcdef> - <paramdef>string <parameter>oldname</parameter></paramdef> - <paramdef>string <parameter>newname</parameter></paramdef> + <paramdef>string <parameter>nomeantigo</parameter></paramdef> + <paramdef>string <parameter>novonome</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Attempts to rename <parameter>oldname</parameter> to - <parameter>newname</parameter>. + Tenta renomear <parameter>nomeantigo</parameter> para + <parameter>novonome</parameter>. </para> - <para> - Returns &true; on success and &false; on failure. + <para> + Retorna &true; em caso de sucesso, &false; caso contrário. </para> </refsect1> </refentry> @@ -2533,24 +2561,25 @@ <refentry id="function.rewind"> <refnamediv> <refname>rewind</refname> - <refpurpose>Rewind the position of a file pointer</refpurpose> + <refpurpose>Reinicializa a posição do ponteiro de arquivos para o início</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>rewind</function></funcdef> <paramdef>int <parameter>fp</parameter></paramdef> </funcprototype> </funcsynopsis> - <para> - Sets the file position indicator for fp to the beginning of the - file stream.</para> <para> If an error occurs, returns 0.</para> - <para> The file pointer must be valid, and must point to a file - successfully opened by <function>fopen</function>. + <para> + Muda o indicador de ponteiro de arquivo fp para o início do + stream do arquivo.</para> <para> Se um erro ocorrer, + retornará 0.</para> <para> O ponteiro de arquivo tem que ser + válido e tem que apontar para um arquivo que foi aberto com + sucesso por <function>fopen</function>. </para> <para> - See also <function>fseek</function> and + Veja também <function>fseek</function> e <function>ftell</function>. </para> </refsect1> @@ -2560,26 +2589,26 @@ <refentry id="function.rmdir"> <refnamediv> <refname>rmdir</refname> - <refpurpose>Removes directory</refpurpose> + <refpurpose>Remover um diretório</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>rmdir</function></funcdef> - <paramdef>string <parameter>dirname</parameter></paramdef> + <paramdef>string <parameter>nomedodir</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Attempts to remove the directory named by pathname. The directory - must be empty, and the relevant permissions must permit. - this. + Tenta remover o diretório com o nome de nomedodir. O diretório + tem que estar vazio e as permissões relevantes permitam a + esta operação. </para> <para> - If an error occurs, returns 0. + Em caso de erro, retorna 0. </para> <para> - See also <function>mkdir</function>. + Veja também <function>mkdir</function>. </para> </refsect1> </refentry> @@ -2587,49 +2616,50 @@ <refentry id="function.stat"> <refnamediv> <refname>stat</refname> - <refpurpose>Gives information about a file</refpurpose> + <refpurpose>Dar informação sobre um arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>array <function>stat</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Gathers the statistics of the file named by filename. + Pegar estatísticas sobre o arquivo com o nome de nomedoarquivo. </para> <para> - Returns an array with the statistics of the file with the - following elements: + Retorna um array com as estatísticas do arquivo com os seguintes + elementos: <orderedlist> <listitem><simpara>device</simpara></listitem> <listitem><simpara>inode</simpara></listitem> <listitem><simpara>inode protection mode</simpara></listitem> - <listitem><simpara>number of links</simpara></listitem> - <listitem><simpara>user id of owner</simpara></listitem> + <listitem><simpara>número de links</simpara></listitem> + <listitem><simpara>user id owner</simpara></listitem> <listitem><simpara>group id owner</simpara></listitem> <listitem><simpara>device type if inode device *</simpara></listitem> - <listitem><simpara>size in bytes</simpara></listitem> + <listitem><simpara>tamanho em bytes</simpara></listitem> <listitem><simpara>time of last access</simpara></listitem> <listitem><simpara>time of last modification</simpara></listitem> <listitem><simpara>time of last change</simpara></listitem> <listitem><simpara>blocksize for filesystem I/O *</simpara></listitem> <listitem><simpara>number of blocks allocated</simpara></listitem> </orderedlist> - * - only valid on systems supporting the st_blksize type--other - systems (i.e. Windows) return -1. + * - somente válido em sistemas supportando o tipo st_blksize--outros + sistemas (por exemplo Windows) retornam -1. </para> <para> - Returns &false; in case of error. + Retorna &false; em caso de erro. </para> <para> - <function>stat</function> doesn't handle URL as does <function>fopen</function>. + <function>stat</function> não suporta URL ao contrário de + <function>fopen</function>. </para> <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> </refsect1> </refentry> @@ -2637,29 +2667,27 @@ <refentry id="function.lstat"> <refnamediv> <refname>lstat</refname> - <refpurpose> - Gives information about a file or symbolic link + <refpurpose>Dar informações sobre um arquivo ou link simbólico </refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>array <function>lstat</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Gathers the statistics of the file or symbolic link named by - filename. This function is identical to the - <function>stat</function> function except that if the - <parameter>filename</parameter> parameter is a symbolic link, the - status of the symbolic link is returned, not the status of the - file pointed to by the symbolic link. + Pega as estatísticas do arquivo ou link simbólico com o nome de + nomedoarquivo. Esta função é identica a <function>stat</function> + exceto que se o parametro <parameter>nomedoarquivo</parameter> + é um link simbólico o status do link simbólico é retornado e não + o status do arquivo apontando pelo link simbólico. </para> <para> - Returns an array with the statistics of the file with the - following elements: + Retorna um array com as estatísticas do arquivo com os seguintes + elementos: <orderedlist> <listitem><simpara>device</simpara></listitem> <listitem><simpara>inode</simpara></listitem> @@ -2675,11 +2703,11 @@ <listitem><simpara>blocksize for filesystem I/O *</simpara></listitem> <listitem><simpara>number of blocks allocated</simpara></listitem> </orderedlist> - * - only valid on systems supporting the st_blksize type--other - systems (i.e. Windows) return -1</para> + * - somente válido em sistemas supportando o tipo st_blksize--outros + sistemas (por exemplo Windows) retornam -1. <para> - The results of this function are cached. See - <function>clearstatcache</function> for more details. + Os resultados desta função são guardados em cache. Veja + <function>clearstatcache</function> para mais detalhes. </para> </refsect1> </refentry> @@ -2687,10 +2715,10 @@ <refentry id="function.realpath"> <refnamediv> <refname>realpath</refname> - <refpurpose>Returns canonicalized absolute pathname</refpurpose> + <refpurpose>Retorna o path absoluto canonicalizado</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>string <function>realpath</function></funcdef> @@ -2698,15 +2726,15 @@ </funcprototype> </funcsynopsis> <para> - <function>realpath</function> expands all symbolic links and - resolves references to '/./', '/../' and extra '/' characters in - the input <parameter>path</parameter> and return the canonicalized - absolute pathname. The resulting path will have no symbolic link, - '/./' or '/../' components. + <function>realpath</function> expande todos os links simbólicos + e resolve referencias para '/./', '/../' e extra caracteres '/' + na entrada pelo <parameter>path</parameter> e retorna o path + absoluto canonicalizado . O path resultante não conterá nenhum + link simbólico ou componentes '/./' e '/../'. </para> <para> <example> - <title><function>realpath</function> example</title> + <title>exemplo de <function>realpath</function></title> <programlisting role="php"> $real_path = realpath ("../../index.php"); </programlisting> @@ -2718,30 +2746,30 @@ <refentry id="function.symlink"> <refnamediv> <refname>symlink</refname> - <refpurpose>Creates a symbolic link</refpurpose> + <refpurpose>Criar um link simbólico</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>symlink</function></funcdef> - <paramdef>string <parameter>target</parameter></paramdef> + <paramdef>string <parameter>alvo</parameter></paramdef> <paramdef>string <parameter>link</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - <function>symlink</function> creates a symbolic link - from the existing <parameter>target</parameter> with - the specified name <parameter>link</parameter>. + <function>symlink</function> cria um link simbólico + do <parameter>alvo</parameter> existente com o nome + especificado em <parameter>link</parameter>. </para> <para> - See also <function>link</function> to create hard links, - and <function>readlink</function> along with + Veja também <function>link</function> para criar hard links, + e <function>readlink</function> junto com <function>linkinfo</function>. </para> <note> <simpara> - This function does not work on Windows systems. + Esta função não funciona em sistemas Windows. </simpara> </note> </refsect1> @@ -2750,10 +2778,10 @@ <refentry id="function.tempnam"> <refnamediv> <refname>tempnam</refname> - <refpurpose>Creates unique file name</refpurpose> + <refpurpose>Criar um nome de arquivo único</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>string <function>tempnam</function></funcdef> @@ -2762,25 +2790,26 @@ </funcprototype> </funcsynopsis> <para> - Creates a unique temporary filename in the specified directory. - If the directory does not exist, <function>tempnam</function> may - generate a filename in the system's temporary directory. - </para> - <para> - Prior to PHP 4.0.6, the behaviour of the - <function>tempnam</function> function was system dependent. On - Windows the TMP environment variable will override the - <parameter>dir</parameter> parameter, on Linux the TMPDIR - environment variable has precedence, while SVR4 will always use - your <parameter>dir</parameter> parameter if the directory it - points to exists. Consult your system documentation on the - tempnam(3) function if in doubt. + Cria um nome de arquivo temporário único no diretório especificado. + Se o diretório não existe, <function>tempnam</function> pode + gerar o nome de arquivo no diretório temporário do sistema. + </para> + <para> + Antes do PHP 4.0.6 o comportamento da função + <function>tempnam</function> era dependente do sistema. + No Windows a váriavel de ambiente do sistema TMP irá + sobresair o parametro <parameter>dir</parameter>, em + Linux a váriavel de ambiente TMPDIR tem precedencia, + enquanto SVR4 irá sempre usar o parametro + <parameter>dir</parameter> se o diretório para o qual + ele aponta existe. Consulte a documentação do seu sistema + para a função tempnam(3) se em dúvida. </para> <para> - Returns the new temporary filename, or the &null; string on - failure. + Retorna o nome temporário do arquivo ou a string &null; em + caso de falha. <example> - <title><function>tempnam</function> example</title> + <title>exemplo de <function>tempnam</function></title> <programlisting role="php"> $tmpfname = tempnam ("/tmp", "FOO"); </programlisting> @@ -2788,14 +2817,14 @@ </para> <note> <simpara> - This function's behavior changed in 4.0.3. The temporary file is also - created to avoid a race condition where the file might appear in the - filesystem between the time the string was generated and before the - the script gets around to creating the file. + O comportamento desta função mudou na versão 4.0.3. O arquivo + temporário é também criado para evitar uma condição de corrida (race) + onde o arquivo pode aparecer no filesystem entre o tempo que a string + foi gerada e antes que o script tem tempo para criar o arquivo. </simpara> </note> <para> - See also <function>tmpfile</function>. + Veja também <function>tmpfile</function>. </para> </refsect1> </refentry> @@ -2803,30 +2832,30 @@ <refentry id="function.tmpfile"> <refnamediv> <refname>tmpfile</refname> - <refpurpose>Creates a temporary file</refpurpose> + <refpurpose>Criar um arquivo temporário</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>tmpfile</function></funcdef> + <funcdef>int <function>arqtmp</function></funcdef> <void/> </funcprototype> </funcsynopsis> <para> - Creates a temporary file with an unique name in write mode, - returning a file handle similar to the one returned by - <function>fopen</function>. - The file is automatically removed when closed (using - <function>fclose</function>), or when the script ends. + Cria um arquivo temporárop com um nome único em modo de + gravação, retornando o handle do arquivo em modo similar ao + retornado por <function>fopen</function>. + O arquivo é automáticamente apagado quando fechado (usando + <function>fclose</function>), ou quando o script acaba. </para> <para> - For details, consult your system documentation on the - <literal>tmpfile(3)</literal> function, as well as the - <filename>stdio.h</filename> header file. + Para detalhes consulte a documentação do seu sistem + na função <literal>tmpfile(3)</literal>, assim como o + header <filename>stdio.h</filename>. </para> <para> - See also <function>tempnam</function>. + Veja também <function>tempnam</function>. </para> </refsect1> </refentry> @@ -2835,39 +2864,39 @@ <refentry id="function.touch"> <refnamediv> <refname>touch</refname> - <refpurpose>Sets modification time of file</refpurpose> + <refpurpose>Mudar o tempo de modificação do arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>touch</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> <paramdef>int <parameter> - <optional>time</optional> + <optional>tempo</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> - Attempts to set the modification time of the file named by - filename to the value given by time. If the option time is not - given, uses the present time. + Tenta mudar o tempo de modificação do arquivo com o nome de + nomedoarquivo para o valor dado por tempo. Se a opção de tempo + não é dada, o tempo atual será usado. </para> <para> - If the file does not exist, it is created. + Se o arquivo não existe, ele é criado. </para> <para> - Returns &true; on success and &false; otherwise. + Retorna &true; em caso de sucesso e &false; caso contrário. <example> - <title><function>touch</function> example</title> + <title>exemplo da função <function>touch</function></title> <programlisting role="php"> -if (touch ($FileName)) { - print "$FileName modification time has been - changed to todays date and time"; +if (touch ($nomedoarquivo)) { + print "o tempo do $nomedoarquivo foi modificado + para o dia e hora de agora"; } else { - print "Sorry Could Not change modification time of $FileName"; + print "Desculpe, não foi possivel modificar o tempo de $nomedoarquivo"; } </programlisting> </example> @@ -2878,10 +2907,10 @@ <refentry id="function.umask"> <refnamediv> <refname>umask</refname> - <refpurpose>Changes the current umask</refpurpose> + <refpurpose>Modificar a umask atual</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>umask</function></funcdef> @@ -2889,17 +2918,18 @@ </funcprototype> </funcsynopsis> <para> - <function>umask</function> sets PHP's umask to mask & 0777 and - returns the old umask. When PHP is being used as a server module, - the umask is restored when each request is finished. + <function>umask</function> modifica o umask do PHP para o mask + & 0777 e retorna o umask antigo. Quando o PHP está sendo + usado como um módulo do servidor o umask é restaurado quando + o pedido acaba. </para> <para> - <function>umask</function> without arguments simply returns the - current umask. + <function>umask</function> sem argumentos simplesmente retorna + o umask atual. </para> <note> <simpara> - This function may not work on Windows systems. + Esta função pode não funcionar em sistemas Windows. </simpara> </note> </refsect1> @@ -2908,29 +2938,29 @@ <refentry id="function.unlink"> <refnamediv> <refname>unlink</refname> - <refpurpose>Deletes a file</refpurpose> + <refpurpose>Deleta um arquivo</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>Descrição</title> <funcsynopsis> <funcprototype> <funcdef>int <function>unlink</function></funcdef> - <paramdef>string <parameter>filename</parameter></paramdef> + <paramdef>string <parameter>nomedoarquivo</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - Deletes <parameter>filename</parameter>. Similar to the Unix C - unlink() function. + Deleta <parameter>nomedoarquivo</parameter>. Similar a função + C no Unix unlink(). </para> <para> - Returns 0 or &false; on an error. + Retorna 0 ou &falso; em caso de erro. </para> <para> - See also <function>rmdir</function> for removing directories. + Veja também <function>rmdir</function> para remover diretórios. </para> <note> <simpara> - This function may not work on Windows systems. + Esta função pode não funcionar em sistemas Windows. </simpara> </note> </refsect1>