Skip to content
This repository was archived by the owner on Feb 12, 2025. It is now read-only.
This repository was archived by the owner on Feb 12, 2025. It is now read-only.

Add recursive search for files in a folder #46

@NexSqaud

Description

@NexSqaud

That will be cool if library have a function to search for files in folders recursively

Maybe something like this:

typedef void(*fileHandler)(const char* folder, const char* file);

void foreachFileInDirectoryRecursive(const char* path, fileHandler handler)
{
    INFO("Looking for files in %s recursively", path);
    FOREACH_FILE_IN_DIR(file, path, {
        if (strcmp(".", file) && strcmp("..", file))
        {
            const char* fullpath = PATH(path, file);
            if (IS_DIR(fullpath))
            {
                foreachFileInDirectoryRecursive(fullpath, handler);
            }
            else
            {
                handler(path, file);
            }

             free(fullpath);
        }
    });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions