That's one of the reasons I built zlob. It literally has an endpoint to do this but if you are talking about glibc there are 2 options
1. fnmatch function which is not ideal because it doesn't take into account all the path specific optimizations and does not support BRACE
2. ALTDIRFUNC flag for globbing let you simulate file system which absolutely sucks
in zlob you can simply call zlob_match_paths(<pattern>, <list>, flags, ptr)
where list would be either c string or rust/zig like slices
jzwinck|22 days ago
https://man7.org/linux/man-pages/man3/fnmatch.3.html
neogoose|21 days ago
1. fnmatch function which is not ideal because it doesn't take into account all the path specific optimizations and does not support BRACE 2. ALTDIRFUNC flag for globbing let you simulate file system which absolutely sucks
in zlob you can simply call zlob_match_paths(<pattern>, <list>, flags, ptr)
where list would be either c string or rust/zig like slices