walk_dir_tree()

walk_dir_tree()#

Recursively walk through a directory tree and process each file and subdirectory.

Prototype

PUBLIC int walk_dir_tree(
    const char  *path,
    int (*callback)(const char *path, void *user_data),
    void        *user_data
);
        

Parameters

Key

Type

Description

path

const char *

The root directory to start walking.

callback

int (*)(const char *, void *)

A function pointer to process each file or subdirectory.

user_data

void *

User-defined data passed to the callback function.


Return Value

Returns 0 on success, or a negative value on failure.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples