zoukankan      html  css  js  c++  java
  • PHP fstat() 函数

    定义和用法

    fstat() 函数返回关于一个打开的文件的信息。

    该函数将返回一个包含下列元素的数组:

    • [0] 或 [dev] - 设备编号
    • [1] 或 [ino] - inode 编号
    • [2] 或 [mode] - inode 保护模式
    • [3] 或 [nlink] - 连接数目
    • [4] 或 [uid] - 所有者的用户 ID
    • [5] 或 [gid] - 所有者的组 ID
    • [6] 或 [rdev] - inode 设备类型
    • [7] 或 [size] - 文件大小的字节数
    • [8] 或 [atime] - 上次访问时间(Unix 时间戳)
    • [9] 或 [mtime] - 上次修改时间(Unix 时间戳)
    • [10] 或 [ctime] - 上次 inode 改变时间(Unix 时间戳)
    • [11] 或 [blksize] - 文件系统 IO 的块大小(如果支持)
    • [12] 或 [blocks] - 所占据块的数目

    语法

    fstat(file)
    参数描述
    file 必需。规定要检查的打开文件。

    提示和注释

    注释:从这个函数返回的结果与服务器到服务器的结果是不相同的。这个数组包含了数字索引、名称索引或同时包含上述二者。

    提示:fstat() 函数与 stat() 函数大致类似。唯一的不同点就是,fstat()函数在使用时,文件必须已经打开。


    实例

    <?php
    $file = fopen("test.txt","r");
    print_r(fstat($file));
    fclose($file);
    ?>

    上面的代码将输出:高佣联盟 www.cgewang.com

    Array
    (
    [0] => 0
    [1] => 0
    [2] => 33206
    [3] => 1
    [4] => 0
    [5] => 0
    [6] => 0
    [7] => 92
    [8] => 1141633430
    [9] => 1141298003
    [10] => 1138609592
    [11] => -1
    [12] => -1
    [dev] => 0
    [ino] => 0
    [mode] => 33206
    [nlink] => 1
    [uid] => 0
    [gid] => 0
    [rdev] => 0
    [size] => 92
    [atime] => 1141633430
    [mtime] => 1141298003
    [ctime] => 1138609592
    [blksize] => -1
    [blocks] => -1
    )
  • 相关阅读:
    Python Revisited Day 13 (正则表达式)
    Python Revisited Day 06 (面向对象程序设计)
    Python Revisited (变量)
    Python Revisited Day 05(模块)
    Python Revisited Day 04 (控制结构与函数)
    Python Revisited Day 03 (组合数据类型)
    Numpy
    Python Revisited Day 01
    Python3使用openpyxl读写Excel文件
    Python3操作YAML文件
  • 原文地址:https://www.cnblogs.com/yc10086/p/13023823.html
Copyright © 2011-2022 走看看