结构体DIR和dirent
生活随笔
收集整理的這篇文章主要介紹了
结构体DIR和dirent
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.存儲目錄中的文件信息(文件名、擴展名等等)#include <dirent.h>
struct dirent{?? long d_ino; /* inode number 索引節點號 */??
?off_t d_off; /* offset to this dirent 在目錄文件中的偏移 */???
unsigned short d_reclen; /* length of this d_name 文件名長 */??
?unsigned char d_type; /* the type of d_name 文件類型 */ ???
char d_name [NAME_MAX+1]; /* file name (null-terminated) 文件名,最長255字符 */
}
2.struct __dirstream?? {
void *__fd; /* `struct hurd_fd' pointer for descriptor.?? */
char *__data; /* Directory block.?? */
int __entry_data; /* Entry number `__data' corresponds to.?? */
char *__ptr; /* Current pointer into the block.?? */
int __entry_ptr; /* Entry number `__ptr' corresponds to.?? */
size_t __allocation; /* Space allocated for the block.?? */
size_t __size; /* Total valid data in the block.?? */
__libc_lock_define (, __lock) /* Mutex lock for this structure.?? */
?? };
typedef struct __dirstream DIR;
總結
以上是生活随笔為你收集整理的结构体DIR和dirent的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: write()和read()
- 下一篇: STDIN_FILENO和stdin区别