guangliang_98

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

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

    }

posted on 2015-04-11 11:55  guangliang_98  阅读(697)  评论(0编辑  收藏  举报