glob, globfree - generate pathnames matching a pattern int
glob(const char *restrict pattern, int flags,
int(*errfunc)(const char *epath, int eerrno), glob_t *restrict
pglob); void globfree(glob_t *pglob); The glob() function is a
pathname generator that shall implement the rules defined in XCU
Pattern Matching Notation, with optional support for rule 3 in
XCU Patterns Used for Filename Expansion. The structure type
glob_t is defined in <glob.h> and includes at least the
following members: Count of paths matched by pattern. Pointer to
a list of matched pathnames. Slots to reserve at the beginning
of gl_pathv. The argument pattern is a pointer to a pathname
pattern to be expanded. The glob() function shall match all
accessible pathnames against this pattern and develop a list of
all pathnames that match. In order to have access to a pathname,
glob() requires search permission on every component of a path
except the last, and read permission on each directory of any
filename component of pattern that contains a