Dirent结构的成员 [英] Members of Dirent structure
问题描述
我已经开始使用dirent.h库了,我遇到了一个非常有用的struct dirent结构的成员,它在我的书中是structntnt * p-> d_name。但是不幸的是,它并没有说明这个结构的任何其他成员:
我想知道这个结构的成员还有什么用的? >
注意
结构 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; / *偏移到下一个方位* /
unsigned short d_reclen; / *此记录的长度* /
unsigned char d_type; / *文件类型不支持
所有文件系统类型* /
char d_name [256]; / * filename * /
};
参考: man readdir
或者只是在include目录中查找dirent.h。
I have started working with dirent.h library and I came across a very useful member of "struct dirent" structer which struct dirent *p->d_name in my book. But unfortunatly it doesn't states any other members of this structure;
I was wondering what else are the members of this structure and what are they used for?
Regards
The structure, struct dirent
refers to directory entry.
http://www.gnu.org/software/libc/manual/html_node/Directory-Entries.html
In linux it is defined as:
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 system types */
char d_name[256]; /* filename */
};
refer: man readdir
Or just look for "dirent.h" in the include directory.
这篇关于Dirent结构的成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!