|
|
 |
stat (PHP 3, PHP 4 ) stat -- Gives information about a file Descriptionarray 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:
device inode inode protection mode number of links user id of owner group id owner device type if inode device * size in bytes time of last access time of last modification time of last change blocksize for filesystem I/O * number of blocks allocated
* - only valid on systems supporting the st_blksize type--other
systems (i.e. Windows) return -1.
Not: The results of this
function are cached. See clearstatcache() for
more details.
Not: 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().
User Contributed Notes stat |
add a note |
ian at eiloart dot com
23-Jul-1999 02:52 |
|
Here's what the UNIX man page on stat has to say about the difference
between a file change and a file modification:
st_mtime Time
when data was last modified. Changed by the following functions:
creat(), mknod(), pipe(), utime(), and write(2).
st_ctime Time
when file status was last changed. Changed by the following
functions: chmod(), chown(), creat(), link(2), mknod(), pipe(), unlink(2),
utime(), and write().
So a modification is a change in the data,
whereas a change also happens if you modify file permissions and so on.
|
|
ngreen at neilsmachine dot com
11-Nov-2000 07:00 |
|
When you get a time from stat, like the date modified, you'll get a
timestamp returned. You can use date() to convert it into a human
readable format:
$modified = stat("yourfile.html");
echo date("l, F dS",$modified[9]);
|
|
add a note |
| |