• 首页
  • vue
  • TypeScript
  • JavaScript
  • scss
  • css3
  • html5
  • php
  • MySQL
  • redis
  • jQuery
  • streamWrapper::url_stat()

    (PHP 4 >= 4.3.2, PHP 5, PHP 7)

    Retrieve information about a file

    说明

    publicstreamWrapper::url_stat(string $path,int $flags): array

    This method is called in response to allstat()related functions, such as:

    参数

    $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.

    FlagDescription
    STREAM_URL_STAT_LINKFor 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_QUIETIf 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