DIR结构体类似于FILE,是一个内部结构
- struct __dirstream
- {
- void *__fd;
- char *__data;
- int __entry_data;
- char *__ptr;
- int __entry_ptr;
- size_t __allocation;
- size_t __size;
- __libc_lock_define (, __lock)
- };
- 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
}
时间: 2024-10-16 15:10:48