1 Star 0 Fork 4.9K

Cain / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
dirent-h.md 9.36 KB
一键复制 编辑 原始数据 按行查看 历史
wenjun 提交于 2020-09-08 10:08 . add OpenHarmony 1.0 baseline

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.

1
https://gitee.com/cain_qin/docs.git
git@gitee.com:cain_qin/docs.git
cain_qin
docs
docs
master

搜索帮助