• fstat stat lstat
    •   原型
      • #include <unistd.h>
      • #include <sys/stat.h>
      • #include <sys/types.h>
      •  
      • // buf:返回信息
      • // fildes:文件描述符
      • // path:文件名
      • int fstat(int fildes, struct stat *buf)
      • int stat(const chat *path, struct stat *buf)
      • int lstat(const char *path, struct stat *buf)
    • stat && lstat
      • 对于符号链接,lstat返回符号链接本身的信息,stat返回链接指向的文件的信息
    • stat结构的成员(不同系统有所不同),一般包括
      • st_mode:文件权限和文件类型信息
      • st_ino:文件关联的inode
      • st_dev:保存文件的设备
      • st_uid:文件属主的UID
      • st_gid:文件属主的GID
      • st_atime:文件上次被访问的时间
      • st_ctime:文件的权限、属主、组或内容上一次被改变的时间
      • st_mtime:文件的内容上一次被修改的时间
      • st_nlink:该文件上的应链接数

相关文章:

  • 2022-03-09
  • 2022-12-23
  • 2021-11-21
  • 2021-11-14
  • 2022-12-23
  • 2021-11-04
  • 2021-10-11
猜你喜欢
  • 2021-08-21
  • 2021-05-21
  • 2021-09-19
  • 2021-07-14
  • 2021-09-15
  • 2022-02-11
  • 2021-07-21
相关资源
相似解决方案