stat

(PHP 3, PHP 4 )

stat -- Gives information about a file

Description

array stat ( string filename)

Gathers the statistics of the file named by filename. If filename is a symbolic link, statistics are from the file itself, not the symlink. lstat() is identical to stat() except it would instead be based off the symlinks status.

In case of error, stat() returns FALSE

Returns an array with the statistics of the file with the following elements:

  1. device

  2. inode

  3. inode protection mode

  4. number of links

  5. user id of owner

  6. group id owner

  7. device type if inode device *

  8. size in bytes

  9. time of last access

  10. time of last modification

  11. time of last change

  12. blocksize for filesystem I/O *

  13. number of blocks allocated

* - only valid on systems supporting the st_blksize type--other systems (i.e. Windows) return -1.

Замечание: The results of this function are cached. See clearstatcache() for more details.

Замечание: This function will not work on remote files as the file to be examined must be accessible via the servers filesystem.

See also lstat(), filemtime(), and filegroup().