dirent.h

Overview

Related Modules:

FS

Description:

Provides functions and structures used for performing file system operations, including file read/write, directory traversal, and file system mounting.

Since:

1.0

Version:

1.0

Summary

Data Structures

Data Structure Name

Description

dirent

Defines the content of the directory.

Typedefs

Typedef Name

Description

DIR

typedef struct __dirstream 

Opens the handle of the folder directory.

Functions

Function Name

Description

closedir (DIR dirp)

int 

Closes a specified directory.

opendir (const char dirname)

DIR  

Opens a specified directory.

readdir (DIR dirp)

struct dirent  

Reads a specified directory.

readdir_r (DIR restrict dirp, struct dirent *restrict entry, struct dirent __restrict result)

int 

Reads a specified directory (thread-safe version).

rewinddir (DIR *dirp)

void 

Resets a directory stream read position.

alphasort (const struct dirent a, const struct dirent b)

int 

Sorts the directory entries in alphabetical order.

scandir (const char dir, struct dirent namelist, int(sel)(const struct dirent ), int(compar)(const struct dirent , const struct dirent ))

int 

Scans directory to find the target entries.

seekdir (DIR dirp, long offset)

void 

Sets the position of the next readdir call in the directory stream.

telldir (DIR *dirp)

long 

Obtains the current position in the specified directory stream.