glob
glob copied to clipboard
Ability to opt out of `**` (have it behave like `*` / POSIX glob)
I'm parsing a file format which uses glob patterns in C. The C glob function on unix does not support **. Instead, a series of consecutive * is the same as writing just one *
demonstrated with a posix shell:
$ ls -ld /usr/**/
drwxr-xr-x 2 root root 77824 Mar 19 16:34 /usr/bin/
drwxr-xr-x 2 root root 4096 Mar 19 09:05 /usr/games/
drwxr-xr-x 4 root root 4096 Nov 29 14:17 /usr/i686-w64-mingw32/
drwxr-xr-x 108 root root 20480 Mar 18 14:23 /usr/include/
drwxr-xr-x 118 root root 4096 Mar 19 16:34 /usr/lib/
drwxr-xr-x 3 root root 4096 Mar 11 09:31 /usr/lib64/
drwxr-xr-x 21 root root 12288 Mar 19 09:32 /usr/libexec/
drwxr-xr-x 12 root root 4096 Feb 19 09:37 /usr/local/
drwxr-xr-x 2 root root 20480 Mar 19 09:32 /usr/sbin/
drwxr-xr-x 347 root root 12288 Mar 19 16:34 /usr/share/
drwxr-xr-x 6 root root 4096 Mar 13 10:14 /usr/src/