streamWrapper::url_stat() - php 流stream类
streamWrapper::url_stat()
(PHP 4 >= 4.3.2, PHP 5, PHP 7)
Retrieve information about a file
说明
publicstreamWrapper::url_stat(string $path,int $flags): arrayThis method is called in response to allstat()related functions, such as:
chmod()
(only whensafe_modeis 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()
参数
$pathThe 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.
$flagsHolds 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 tolstat(),is_link(),orfiletype(). |
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 thetrigger_error()function during stating of the path. |
返回值
Should return as many elements asstat()does. Unknown or unavailable values should be set to a rational value (usually0
). Pay special attention tomodeas documented understat().
错误/异常
调用此方法失败将给出E_WARNING
(未实现)。
注释
Note:当合法的上下文传递给调用函数时,属性streamWrapper::$context会被改变。
参见
stat()
给出文件的信息- streamwrapper::stream_stat() Retrieve information about a file resource
鹏仔微信 15129739599 鹏仔QQ344225443 鹏仔前端 pjxi.com 共享博客 sharedbk.com
图片声明:本站部分配图来自网络。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!