首页 > 其他 > 详细

DIR和dirent结构体

时间:2015-04-11 13:00:43      阅读:166      评论:0      收藏:0      [点我收藏+]

DIR结构体类似于FILE,是一个内部结构

  1. struct __dirstream
  2.    {
  3. void *__fd;
  4. char *__data;
  5. int __entry_data;
  6. char *__ptr;
  7. int __entry_ptr;
  8. size_t __allocation;
  9. size_t __size;
  10.     __libc_lock_define (, __lock)
  11.    };
  12. typedef struct __dirstream DIR;

    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 the file system types;

    char d_name[256];                           //filename

    }

DIR和dirent结构体

原文:http://www.cnblogs.com/guangliang/p/4417298.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!