PHP streamWrapper url_stat() Method
The PHP streamWrapper::url_stat() method retrieves information about a file. This method is called in response to all stat() related functions, such as:
- copy()
- fileperms()
- fileinode()
- filesize()
- fileowner()
- filegroup()
- fileatime()
- filemtime()
- filectime()
- filetype()
- is_writable()
- is_readable()
- is_executable()
- is_file()
- is_dir()
- is_link()
- file_exists()
- lstat()
- stat()
- SplFileInfo::getPerms()
- SplFileInfo::getInode()
- SplFileInfo::getSize()
- SplFileInfo::getOwner()
- SplFileInfo::getGroup()
- SplFileInfo::getATime()
- SplFileInfo::getMTime()
- SplFileInfo::getCTime()
- SplFileInfo::getType()
- SplFileInfo::isWritable()
- SplFileInfo::isReadable()
- SplFileInfo::isExecutable()
- SplFileInfo::isFile()
- SplFileInfo::isDir()
- SplFileInfo::isLink()
- RecursiveDirectoryIterator::hasChildren()
Syntax
public streamWrapper::url_stat(path, flags)
Parameters
path |
|
flags |
Required. Specify additional flags set by the streams API. It can hold one or more of the following values OR'd together:
|
Return Value
Returns an array with the same elements as stat() function. Unknown or unavailable values is set to a rational value (usually 0). Returns false on failure.
Exceptions
Emits E_WARNING if call to this method fails (i.e. not implemented).
Note: The streamWrapper::$context property is updated if a valid context is passed to the caller function.
❮ PHP Streams Reference