Skip to content

Conversation

@gaogao-qwq
Copy link

@gaogao-qwq gaogao-qwq commented Jan 21, 2026

Just like #114. This pr introduce nob_filepath_match() which similar to Go's path.Match() or GNU Make's ($wildcard pattern...). And enhanced nob_read_entire_dir() with .recursively and .wildcard options without breaking forward compability.

e.g.

.
├── external
│   ├── foobar
│   │   ├── foobar.h
│   │   ├── libfoobar.a
│   │   └── libfoobar.so
│   └── foobarbaz
│       ├── foobarbaz.h
│       ├── libfoobarbaz.a
│       └── libfoobarbaz.so
├── include
│   ├── bar
│   │   └── bar.h
│   ├── baz.h
│   └── foo
│       └── foo.h
└── src
    ├── bar
    │   └── bar.c
    ├── baz.c
    └── foo
        └── foo.c

nob_read_entire_dir(".", &children, .recursively = true, .wildcard = "./src/*.c"):
    ./src/baz.c
nob_read_entire_dir(".", &children, .recursively = true, .wildcard = "./src/**/*.c"):
    ./src/bar/bar.c
    ./src/foo/foo.c
nob_read_entire_dir(".", &children, .recursively = true, .wildcard = "./external/**/*.so"):
    ./external/foobarbaz/libfoobarbaz.so
    ./external/foobar/libfoobar.so

@gaogao-qwq gaogao-qwq force-pushed the wildcard branch 4 times, most recently from 8b75490 to b9ede99 Compare January 23, 2026 12:50
Signed-off-by: gaogao-qwq <gaogaoqwq@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants