The php Function Lstat
The php function lstat provides information about a particular file or symbolic link. It takes a path as the argument and returns an array of data on its status. The information gathered by this function is cached, so itβs recommended to use clearstatcache() before calling it again.
st_mode β Mode of the file; this value can be any of the modes defined in the mknod(2) manual page: S_IFSOCK for sockets, S_IFDOOR for doors, S_IFPORT for event ports, or S_IFLNK for symbolic links. The st_ino and st_dev pair uniquely identify files in a file system.
S_SIZE β Size of the file in bytes. This field may not be updated when a file is opened. S_MOD β Modification time of the file. The date and time of the modification are recorded here, if available, and is useful when comparing files.
ERROR_FAILURE
If a file descriptor is open, but the stat() call fails for any reason, a failure status (E_WARNING) is returned. This error can be caused by problems such as lack of disk space, a file being locked, or even the system having too many processes running simultaneously.
These functions conform to SVr4, 4.3BSD, and POSIX.1-2001. When a file or symbolic link is being examined, the results are similar to those of stat(). However, if the path argument is a symbolic link, the information about the link is returned instead of that about the original file. This is the behavior imposed by the POSIX standard.