HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

fstat

Description

The fstat of Filesystem for PHP gets information about a file using an open file pointer.

Syntax

fstat(
    resource $stream
): array|false

Parameters

stream

A file system pointer resource that is typically created using fopen().

Return

Returns an array with the statistics of the file; the format of the array is described in detail on the stat() manual page. Returns false on failure.

Examples

1 · stream

<?

$filename = $_SERVER['DOCUMENT_ROOT']. '/assets/txt/1.txt';
$mode = 'r';

$stream = fopen($filename, $mode);

    $return = fstat($stream);

    print_r($return);

fclose($stream);
Array
(
    [0] => 2065
    [1] => 149565440
    [2] => 33188
    [3] => 1
    [4] => 1175
    [5] => 1180
    [6] => 0
    [7] => 5
    [8] => 1708618679
    [9] => 1733489499
    [10] => 1733489499
    [11] => 4096
    [12] => 8
    [dev] => 2065
    [ino] => 149565440
    [mode] => 33188
    [nlink] => 1
    [uid] => 1175
    [gid] => 1180
    [rdev] => 0
    [size] => 5
    [atime] => 1708618679
    [mtime] => 1733489499
    [ctime] => 1733489499
    [blksize] => 4096
    [blocks] => 8
)