Current Location: Home> Function Categories> fstat

fstat

Get file information through the opened file pointer
Name:fstat
Category:File system
Programming Language:php
One-line Description:Returns information about an open file.

Definition and usage

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
)

grammar

 fstat ( file )
parameter describe
pipe Required. Specify the opening file to be checked.

illustrate

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
Similar Functions
  • Modify the owner of the symbolic link lchown

    lchown

    Modifytheownerofthes
  • Change the current umask umask

    umask

    Changethecurrentumas
  • Move uploaded files to a new location move_uploaded_file

    move_uploaded_file

    Moveuploadedfilestoa
  • Positioning in file pointer fseek

    fseek

    Positioninginfilepoi
  • Returns the location where the file pointer is read/write ftell

    ftell

    Returnsthelocationwh
  • Format the line to CSV and write to the file pointer fputcsv

    fputcsv

    FormatthelinetoCSVan
  • Export buffered content to file fflush

    fflush

    Exportbufferedconten
  • Get file modification time filemtime

    filemtime

    Getfilemodificationt
Popular Articles