fstat
Get file information through the opened file pointer
fstat()
function returns information about opening the file.
<?php $file = fopen("test.txt","r"); print_r(fstat($file)); fclose($file); ?>
输出类似:
Array ( [0] => 0 [1] => 0 [2] => 33206 [3] => 1 [4] => 0 [5] => 0 [6] => 0 [7] => 92 [8] => 1141633430 [9] => 1141298003 [10] => 1138609592 [11] => -1 [12] => -1 [dev] => 0 [ino] => 0 [mode] => 33206 [nlink] => 1 [uid] => 0 [gid] => 0 [rdev] => 0 [size] => 92 [atime] => 1141633430 [mtime] => 1141298003 [ctime] => 1138609592 [blksize] => -1 [blocks] => -1 )
fstat ( file )
parameter | describe |
---|---|
pipe | Required. Specify the opening file to be checked. |
Gets statistics about files opened by file pointer handle.
The array returned by this function has statistics for the file, which contains the following elements:
Digital subscript | Associated Key Name (from PHP 4.0.6) | illustrate |
---|---|---|
0 | dev | Device name |
1 | ino | Number |
2 | mode | inode protection mode |
3 | nlink | Number of connected |
4 | uid | Owner's user id |
5 | gid | Owner's group id |
6 | rdev | Device type, if it is an inode device |
7 | size | Number of bytes of file size |
8 | atime | Last access time (Unix timestamp) |
9 | mtime | Last modified time (Unix timestamp) |
10 | ctime | Last time changed (Unix timestamp) |
11 | blksize | Block size of file system IO |
12 | Blocks | The number of blocks occupied |