1 Star 0 Fork 4.9K

famoustang / docs

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

ftw.h

Overview

Related Modules:

FS

Description:

Provides functions and structures related to file tree traversal.

You can use the functions and structures to traverse files in a specified directory to obtain or process related information.

Since:

1.0

Version:

1.0

Summary

Data Structures

Data Structure Name

Description

FTW

Defines the file tree walker (FTW).

Macros

Macro Name and Value

Description

FTW_F   1

Regular file.

FTW_D   2

Directory.

FTW_DNR   3

Unreadable directory. Its subdirectories will not be traversed.

FTW_NS   4

The data of the stat structure cannot be obtained. The possible cause is that the permission is incorrect.

FTW_SL   5

Symbolic link.

FTW_DP   6

 

FTW_SLN   7

Symbolic link that names a non-existent file.

FTW_PHYS   1

Symbolic links that are not traversed. If not set, symbolic links are traversed by default.

FTW_MOUNT   2

Stay within the same file system.

FTW_CHDIR   4

chdir is called to go to the directory before reading the directory.

FTW_DEPTH   8

All subdirectories will be traversed before the directory itself.

Functions

Function Name

Description

ftw (const char *path, int(*fn)(const char *file, const struct stat *sb, int flag), int depth)

int 

Traverses a file tree.

nftw (const char *path, int(*fn)(const char *file, const struct stat *sb, int flag, struct FTW *s), int fd_limit, int flags)

int 

Traverses a file tree.

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

搜索帮助