该结构struct dirent
是指目录条目。
http://www.gnu.org/software/libc/manual/html_node/Directory- Entries.html
在linux中,它定义为:
struct 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 sy@R_419_2354@ types */
char d_name[256]; /* filename */
};
参考: man readdir
或者只是在包含目录中查找“ dirent.h”。