从帮助中查信息
1 | $ man -k direct | grep read |
目录结构所在的头文件
- dirent.h
1
#include <dirent.h>
保存目录内容的结构体
- 结构体 -
dirent
1
2
3
4
5
6
7
8struct dirent {
ino_t d_ino; /* inode number */
off_t d_off; /* offset to the next dirent */
unsigned short d_reclen; /* length of this record */
unsigned char d_type; /* type of file; not supported
by all file system types */
char d_name[256]; /* filename */
};