Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
glob(3) OSS Library Calls Reference Manual
NAME
glob - Generates pathnames matching a pattern
LIBRARY
G-series native OSS processes: /G/system/sysnn/zossesrl
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zossedll |
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/yossedll |
SYNOPSIS
#include <glob.h>
int glob(
const char *pattern,
int flags,
int (*errfunc)(constr char *epath, int eerrno),
glob_t *pglob);
PARAMETERS
pattern Contains the filename pattern to compare against accessible pathnames.
flags Controls the customizable behavior of the glob( ) function.
errfunc Specifies an optional function that, if specified, is called when the glob( ) func-
tion detects an error condition.
epath Contains the pathname that failed because a directory could not be opened or
read.
eerrno Specifies the errno value from a failure specified by the epath parameter, as set
by the opendir( ), readdir( ),orstat( ) function.
pglob Contains a pointer to a glob_t structure. The structure is allocated by the caller.
The array of structures containing the filenames that match the pattern parameter
is stored by the glob( ) function into the structure. The last entry is a null pointer.
DESCRIPTION
The glob( ) function constructs a list of accessible files whose names match the pattern parame-
ter.
The glob( ) function matches all accessible pathnames against pattern and develops a list of all
pathnames that match. To have access to a pathname, the glob( ) function requires search per-
mission on every component of the pathname except the last and requires read permission on
each directory of any filename component of pattern that contains any of the special characters *
(asterisk), ? (question mark), or [ (open bracket).
The glob( ) function stores the number of matched pathnames and a pointer to a list of pointers to
pathnames in the glob_t structure pointed to by the pglob parameter. The glob_t structure has the
following format:
typedef struct glob_t {
size_t gl_pathc;
char **gl_pathv;
size_t gl_offs;
void *gl_padr;
void *gl_ptx;
}glob_t;
The fields in the structure have the following content:
3−160 Hewlett-Packard Company 527187-017