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: Sat, 24 Mar 2007

view this page in

fstat

(PHP 4, PHP 5)

fstat — Vrací informace o otevřeném souboru

Popis

array fstat ( resource $handle )

Sbírá statistiky otevřeného souboru specifikovaném deskriptorem fp. Tato funkce je podobná funkci stat(), pracuje však s deskriptorem, nikoli názvem souboru.

Vrací pole se statistikami souboru s těmito elementy:

  1. device
  2. inode
  3. number of links
  4. user id of owner
  5. group id owner
  6. device type if inode device *
  7. size in bytes
  8. time of last access
  9. time of last modification
  10. time of last change
  11. blocksize for filesystem I/O *
  12. number of blocks allocated
* - platné pouze na systémech s podporou typu st_blksize -- jinde (např. na Windows) vrací -1

Výsledek této funkce je cachován. Více detailů - viz clearstatcache().



ftell> <fseek
Last updated: Sat, 24 Mar 2007
 
add a note add a note User Contributed Notes
fstat
mordae at mordae dot net
29-Jan-2006 07: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
21-Feb-2001 05:14
On Windows NT the typical array element names for the fstat function are:

dev
ino
mode
nlink
uid
gid
size
atime
mtime
ctime
jason at inetgurs dot net
14-Nov-2000 07:01
Currently fstat() is indexed by name instead of by number like stat().

Example: $s_array=fstat($fp); print $s_array["mtime"];fclose($fp);

ftell> <fseek
Last updated: Sat, 24 Mar 2007
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites