DIR和dirent结构体

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

    }

你可能感兴趣的:(结构体)