100% POSIX and glibc compatible globbing library for C, Zig, and Rust that is faster and supports all the modern globbing formats (more than libc and rust glob crate)
It supports all the formats like * and {a,b} expansion as long as have a very efficient syscall and SIMD optimization for faster processing
gary_0 15 hours ago [-]
Thanks for sharing. Just curious, is there any way to perform globbing over a list of path-like strings instead of only directly on the filesystem?
jzwinck 12 hours ago [-]
In case someone doesn't know, the standard function for that is called fnmatch:
,, Why? Because glob() implemented by glibc sucks. It is very outdated and slow.''
Isn't this a great opportuninty to improve glibc itself instead? Have you tried contributing back and make all programs that use glibc work faster now that you have a lot of knowledge about the problem space?
Anyways congrats to your project!
kvuj 5 hours ago [-]
There is probably greater joy in quickly making a tool to solve a problem you face than spending months if not years trying to convince glibc maintainers that your redesign will help a majority of users all the while conforming to their demands.
oguz-ismail2 15 hours ago [-]
Since when `{...}' syntax is a glob pattern? What does `{a,b}/c' produce when there is no directory named `a'?
hidroto 14 hours ago [-]
would it not just produce 'b/c'? assuming 'b/c' is an existent file path
what else could you justify it doing?
thayne 14 hours ago [-]
The behavior of bash would be to produce "a/c" and "b/c", even if both files don't exist
sgbeal 9 hours ago [-]
> The behavior of bash would be to produce "a/c" and "b/c", even if both files don't exist
In bash patterns like {a,b} aren't glob-expansion expansions, they're string operations, and those resolve before glob expansions.
You can confirm this with: ls /{nope,tmp}
frizlab 10 hours ago [-]
zsh too
oguz-ismail2 14 hours ago [-]
What sibling comment says. Bash does suppress nonexistent products when the pattern includes a glob metacharacter and `shopt -s nullglob' is in effect, but I didn't see a flag or anything to achieve that in the project README.
9 hours ago [-]
Spivak 9 hours ago [-]
Globbing is a matching library. It just means match a/c or b/c if they exist. You should get an iterator of somewhere between zero and two elements.
commandersaki 14 hours ago [-]
Nice licence, I would've probably used this a few years ago on a project had I known it existed.
kreetx 13 hours ago [-]
Was this vibe coded? Readme has typos and somehow reads "fast and loose".
kryptiskt 13 hours ago [-]
I thought typos was a signifier for human-created these days, because an LLM is unlikely to land on something that is not a word.
Rendered at 22:35:51 GMT+0000 (Coordinated Universal Time) with Vercel.
It supports all the formats like * and {a,b} expansion as long as have a very efficient syscall and SIMD optimization for faster processing
https://man7.org/linux/man-pages/man3/fnmatch.3.html
Isn't this a great opportuninty to improve glibc itself instead? Have you tried contributing back and make all programs that use glibc work faster now that you have a lot of knowledge about the problem space?
Anyways congrats to your project!
what else could you justify it doing?
In bash patterns like {a,b} aren't glob-expansion expansions, they're string operations, and those resolve before glob expansions.
You can confirm this with: ls /{nope,tmp}