struct Dirent and Dir

Source: Internet
Author: User

1. Store the file information in the directory (file name, extension, etc.)

#include <dirent.h>struct Dirent{long D_ino; */inode Number Index node * /off_t d_off; */* offset to this dirent offsets in the catalog file * /unsigned short d_reclen; * * length of this d_name filename long * /unsigned char d_type; * * The type of d_name file type * /Char d_name [name_max+1];/* file name (null-terminated) filename, maximum 255 characters */}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;

struct Dirent and Dir

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.