Dirent结构的成员

我已经开始使用dirent.h库了,我在书中遇到了一个非常有用的“struct dirent”结构体,其中struct dirent * 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;       /* 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 */
};

参考:man readdir

或者只是在include目录中查找“dirent.h”.

相关文章

本程序的编译和运行环境如下(如果有运行方面的问题欢迎在评...
水了一学期的院选修,万万没想到期末考试还有比较硬核的编程...
补充一下,先前文章末尾给出的下载链接的完整代码含有部分C&...
思路如标题所说采用模N取余法,难点是这个除法过程如何实现。...
本篇博客有更新!!!更新后效果图如下: 文章末尾的完整代码...
刚开始学习模块化程序设计时,估计大家都被形参和实参搞迷糊...