Re:Zlob.h 100% POSIX and glibc compatible globbing lib that ...
by oguz-ismail2 on Saturday February 07, 2026 @02:38AM
(#46922054)
Since when `{...}' syntax is a glob pattern? What does `{a,b}/c' produce when there is no directory named `a'?
[ Parent
| on HN ]
Re:Zlob.h 100% POSIX and glibc compatible globbing lib that ...
by hidroto on Saturday February 07, 2026 @03:06AM
(#46922179)
would it not just produce 'b/c'? assuming 'b/c' is an existent file path
what else could you justify it doing?
Re:Zlob.h 100% POSIX and glibc compatible globbing lib that ...
by oguz-ismail2 on Saturday February 07, 2026 @03:16AM
(#46922224)
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 ...
by thayne on Saturday February 07, 2026 @03:09AM
(#46922192)
The behavior of bash would be to produce "a/c" and "b/c", even if both files don't exist
Re:Zlob.h 100% POSIX and glibc compatible globbing lib that ...
by frizlab on Saturday February 07, 2026 @07:37AM
(#46923369)
zsh too
Re:Zlob.h 100% POSIX and glibc compatible globbing lib that ...
by sgbeal on Saturday February 07, 2026 @09:02AM
(#46923970)
> 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 ...
by Spivak on Saturday February 07, 2026 @08:29AM
(#46923695)
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.
Re:Zlob.h 100% POSIX and glibc compatible globbing lib that ...
by neogoose on Sunday February 08, 2026 @01:30PM
(#46937075)
Since glibc (better to say csh) implemented it. https://man7.org/linux/man-pages/man3/glob.3.html search for GLOB_BRACE