fstat
Description
The fstat of Filesystem for PHP gets information about a file using an open file pointer.
Syntax
fstat(
resource $stream
): array|falseParameters
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] => 58394992
[2] => 33188
[3] => 1
[4] => 1582
[5] => 1586
[6] => 0
[7] => 5
[8] => 1745606430
[9] => 1762637988
[10] => 1762637988
[11] => 4096
[12] => 8
[dev] => 2065
[ino] => 58394992
[mode] => 33188
[nlink] => 1
[uid] => 1582
[gid] => 1586
[rdev] => 0
[size] => 5
[atime] => 1745606430
[mtime] => 1762637988
[ctime] => 1762637988
[blksize] => 4096
[blocks] => 8
)
Links
Filesystem
- basename
- chgrp
- chmod
- chown
- clearstatcache
- copy
- dirname
- disk_free_space
- disk_total_space
- diskfreespace
- fclose
- feof
- fflush
- fgetc
- fgetcsv
- fgets
- file
- file_exists
- file_get_contents
- file_put_contents
- fileatime
- filectime
- filegroup
- fileinode
- filemtime
- fileowner
- fileperms
- filesize
- filetype
- flock
- fnmatch
- fopen
- fpassthru
- fputcsv
- fputs
- fread
- fscanf
- fseek
- ftell
- ftruncate
- fwrite
- glob
- is_dir
- is_executable
- is_file
- is_link
- is_readable
- is_uploaded_file
- is_writable
- is_writeable
- lchgrp
- lchown
- link
- linkinfo
- lstat
- mkdir
- move_uploaded_file
- pathinfo
- pclose
- popen
- readfile
- readlink
- realpath
- realpath_cache_get
- realpath_cache_size
- rename
- rewind
- rmdir
- set_file_buffer
- stat
- symlink
- tempnam
- tmpfile
- touch
- umask
- unlink