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
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?
Zlob.h 100% POSIX and glibc compatible globbing lib that is faste and better
11–20 of 22 posts
Re: Zlob.h 100% POSIX and glibc compatible globbing lib that is faste and better
#12Re: Zlob.h 100% POSIX and glibc compatible globbing lib that is faste and better
#13Since when `{...}' syntax is a glob pattern? What does `{a,b}/c' produce when there is no directory named `a'?
Re: Zlob.h 100% POSIX and glibc compatible globbing lib that is faste and better
#14Earlier quoted context omitted.
would it not just produce 'b/c'? assuming 'b/c' is an existent file path what else could you justify it doing?
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}
Re: Zlob.h 100% POSIX and glibc compatible globbing lib that is faste and better
#15Earlier quoted context omitted.
would it not just produce 'b/c'? assuming 'b/c' is an existent file path what else could you justify it doing?
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.
Re: Zlob.h 100% POSIX and glibc compatible globbing lib that is faste and better
#16Isn'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!
Re: Zlob.h 100% POSIX and glibc compatible globbing lib that is faste and better
#17,, 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!
Re: Zlob.h 100% POSIX and glibc compatible globbing lib that is faste and better
#18,, 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!
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.
Re: Zlob.h 100% POSIX and glibc compatible globbing lib that is faste and better
#19100% 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
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?
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(, , flags, ptr)
where list would be either c string or rust/zig like slices
Re: Zlob.h 100% POSIX and glibc compatible globbing lib that is faste and better
#20,, 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!
While I need this because everyone expects it to be available. Another reason is the API for thing like someone else asked here already (match in memory over a list of paths)