DIR(5), dirent(5) 目录文件格式
来源:互联网 发布:json查看工具 编辑:程序博客网 时间:2024/06/07 02:32
类型:
文件格式和转换 File formats and conventions
结构体定义:
/* structure describing an open directory. */typedef struct _dirdesc {int __dd_fd; /* file descriptor associated with directory */long __dd_loc; /* offset in current buffer */long __dd_size; /* amount of data returned by getdirentries */char *__dd_buf; /* data buffer */int __dd_len; /* size of data buffer */long __dd_seek; /* magic cookie returned by getdirentries */long __dd_rewind; /* magic cookie for rewinding */int __dd_flags; /* flags for readdir */pthread_mutex_t __dd_lock; /* for thread locking */struct _telldir *__dd_td; /* telldir position recording */} DIR;
struct dirent { ino_t d_ino; /* file number of entry */ __uint16_t d_reclen; /* length of this record */ __uint8_t d_type; /* file type, see below */ __uint8_t d_namlen;/* length of string in d_name */ char d_name[255 + 1];/* name must be no longer than this */};
用法:
opendir()函数返回一个指向 DIR 结构的指针
readdir()和closedir()函数以 DIR结构的指针作为函数参数
readdir()函数返回一个指向 dirent 结构的指针
0 0
- DIR(5), dirent(5) 目录文件格式
- struct dirent和DIR
- dir stat dirent
- dirent结构 & DIR结构 定义
- 结构体DIR和dirent
- dirent和DIR 结构体 --- 表示文件夹中目录内容信息
- DIR和dirent 用来获取某文件夹目录内容的结构体
- linux目录编程:DIR,stat, dirent结构体解析与应用
- scandir 读取特定目录的数据表头文件:#include 定义函数:int scandir(const char *dir, struct dirent **namelist, nt (*select) (const struct dirent
- Linux下目录文件的操作(opendir,readdir,closedir) 以及DIR,dirent,stat等结构体详解
- linux目录相关函数opendir、readdir、rewinddir、closedir、telldir、seekdir、stat函数和DIR、dirent、stat结构体详解
- DIR,dirent,stat结构体详解
- DIR stat dirent 结构体 及其用法
- DIR和dirent结构体区别
- struct dirent 和 DIR结构体 详解
- Linux下DIR,dirent,stat 结构体
- struct dirent和DIR结构体
- 文件系统中 DIR、STAT、DIRENT解析
- Activiti(四)流程变量
- 从硬盘设计思想到RAID改良之道
- C++拷贝构造函数详解
- poj3352 Road Construction
- GIT——乱乱的理解
- DIR(5), dirent(5) 目录文件格式
- 派生类的构造函数
- hrbust 1000 A + B Problem【600篇原创纪念】
- 二叉搜索树(Binary Search Tree)
- RaspberryPi 3B 之初体验笔记(续二,python篇)
- KMP
- 1A. Theatre Square
- C++设计模式浅识解释器模式
- WebService三大基本元素 SOAP WSDL UDDI