streamWrapper::url_stat
(PHP 4 >= 4.3.2, PHP 5, PHP 7)
streamWrapper::url_stat — Retrieve information about a file
Description
$path
, int $flags
) : arrayThis method is called in response to all stat() related functions, such as:
- chmod() (only when safe_mode is enabled)
- 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()
Parameters
-
path
-
The file path or URL to stat. Note that in the case of a URL, it must be a :// delimited URL. Other URL forms are not supported.
-
flags
-
Holds additional flags set by the streams API. It can hold one or more of the following values OR'd together.
Flag Description STREAM_URL_STAT_LINK For resources with the ability to link to other resource (such as an HTTP Location: forward, or a filesystem symlink). This flag specified that only information about the link itself should be returned, not the resource pointed to by the link. This flag is set in response to calls to lstat(), is_link(), or filetype(). STREAM_URL_STAT_QUIET If this flag is set, your wrapper should not raise any errors. If this flag is not set, you are responsible for reporting errors using the trigger_error() function during stating of the path.
Return Values
Should return as many elements as stat() does.
Unknown or unavailable values should be set to a rational value
(usually 0
).
Notes
Note:
The streamWrapper::$context property is updated if a valid context is passed to the caller function.
See Also
- stat() - Gives information about a file
- streamwrapper::stream_stat() - Retrieve information about a file resource
English translation
You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.
Thank you in advance.
Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-streamwrapper.url-stat.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.