PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

flock> <filesize
Last updated: Fri, 22 Aug 2008

view this page in

filetype

(PHP 4, PHP 5)

filetypeLê o tipo do arquivo

Descrição

string filetype ( string $filename )

Retorna o tipo do arquivo.

Parâmetros

filename

Caminho até o arquivo.

Valor Retornado

Retorna o tipo do arquivo. Os valores possíveis são fifo, char, dir, block, link, file, socket e unknown (desconhecido).

Retorna FALSE se ocorrer algum erro. filetype() também produzirá uma mensagem E_NOTICE se a chamada stat falhar ou se o tipo do arquivo for desconhecido.

Exemplos

Exemplo #1 Exemplo de filetype()

<?php

echo filetype('/etc/passwd');  // file
echo filetype('/etc/');        // dir

?>

Notas

Nota: O resultado desta função é cacheada. Veja clearstatcache() para mais detalhes.

Dica

A partir do PHP 5.0.0, esta função também pode ser utilizada com alguns wrappers URL. Veja List of Supported Protocols/Wrappers para uma lista de quais wrappers são suportados pela família de funções stat().



add a note add a note User Contributed Notes
filetype
ruach at chpc dot utah dot edu
10-Mar-2004 05:11
There are 7 values that can be returned. Here is a list of them and what each one means

block: block special device

char: character special device

dir: directory

fifo: FIFO (named pipe)

file: regular file

link: symbolic link

unknown: unknown file type

flock> <filesize
Last updated: Fri, 22 Aug 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites