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

search for in the

ftell> <fseek
Last updated: Fri, 18 Jul 2008

view this page in

fstat

(PHP 4, PHP 5)

fstat — Restituisce le informazioni riguardanti un file attraverso un puntatore al file aperto

Descrizione

array fstat ( resource $handle )

Restituisce le statistiche del file aperto dal puntatore handle . Questa funzione è simile a stat() eccetto per il fatto che opera su un puntatore a file aperto invece che su un nome di file.

Restituisce un vettore con le statistiche del file con il formato del vettore è descritto nella pagina di stat().

Example #1 Esempio di uso di fstat()

<?php

// apertura del file
$fp fopen("/etc/passwd""r");

// raccolta delle informazioni
$fstat fstat($fp);

// chiusura del file
fclose($fp);

// scrittura della sola parte associativa
print_r(array_slice($fstat13));

?>

l'esempio visualizzerà :

Array
(
    [dev] => 771
    [ino] => 488704
    [mode] => 33188
    [nlink] => 1
    [uid] => 0
    [gid] => 0
    [rdev] => 0
    [size] => 1114
    [atime] => 1061067181
    [mtime] => 1056136526
    [ctime] => 1056136526
    [blksize] => 4096
    [blocks] => 8
)

Nota: I risultati di questa funzione saranno memorizzati. Vedere clearstatcache() per maggiori dettagli.

Nota: Questa funzione non opererà su file remoti perché il file che deve essere esaminato deve essere accessibile attraverso il filesysmte del server.



add a note add a note User Contributed Notes
fstat
mordae at mordae dot net
29-Jan-2006 04:12
dom at dodgydom dot com wrote:
Best way i found was to open the url into $data and make a temporary file with the contents of $data then get the fstats on the temporary file :).

OMG why? The only thing that will remain is the file size. You also download up to 1G file, which probably is not what you want.

To get size use PHP's function filesize() with URL wrappers or ask yourself via HTTP.
sheran at comtrust dot co dot ae
22-Feb-2001 02:14
On Windows NT the typical array element names for the fstat function are:

dev
ino
mode
nlink
uid
gid
size
atime
mtime
ctime

ftell> <fseek
Last updated: Fri, 18 Jul 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites