Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support filename wildcards on windows commandline (*.dll) #85

Open
jaromil opened this issue Dec 19, 2024 · 0 comments
Open

Support filename wildcards on windows commandline (*.dll) #85

jaromil opened this issue Dec 19, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@jaromil
Copy link
Member

jaromil commented Dec 19, 2024

Wildcards, such as * and ?, don't work directly with standard C functions like fopen(3) or open(3) on Windows because the C standard library functions don't expand wildcards into lists of filenames.

To process wildcards we need to use the Windows API, specifically functions like FindFirstFile and FindNextFile.

Example:

#include <windows.h>
#include <stdio.h>

int main() {
    WIN32_FIND_DATA findFileData;
    HANDLE hFind = FindFirstFile("*.txt", &findFileData);

    if (hFind == INVALID_HANDLE_VALUE) {
        printf("No files found.\n");
        return 1;
    } else {
        do {
            printf("Found file: %s\n", findFileData.cFileName);
        } while (FindNextFile(hFind, &findFileData) != 0);

        FindClose(hFind);
    }

    return 0;
}

Such a parsing logic should go into a function in src/file.c then called by src/cjit.c to parse arguments.

@jaromil jaromil added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant