Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

OSS Library Calls (g - h) glob(3)
gl_pathc The count of the pathnames that match the specified pattern.
gl_pathv A pointer to the list of matching pathnames.
gl_offs The number of entries in the gl_pathv list reserved for matching pathnames.
gl_padr A pointer to the structure that contains the addresses of matching pathnames.
gl_ptx A pointer to the first text buffer containing a matching pathname.
The matching pathnames are sorted, based on the setting of the LC_COLLATE category in the
current locale. The first pointer after the pointer to the last pathname is a null pointer.
If the pattern does not match any pathnames, the returned number of matched pathnames is 0
(zero).
The flags parameter is used to control the behavior of the glob( ) function. The flags value is the
bitwise inclusive OR ( | ) of any of the following constants, which are defined in the glob.h
header file.
GLOB_APPEND
Appends pathnames located with this call to any pathnames previously located.
GLOB_DOOFFS
Uses the gl_offs field in the structure pointed to by the pglob parameter to
specify the number of null pointers to add to the beginning of the gl_pathv com-
ponent of the structure.
GLOB_ERR Causes the glob( ) function to return when it encounters a directory that it cannot
open or read. If the GLOB_ERR ag is not set, the glob( ) function continues to
look for matches if it encounters a directory that it cannot open or read.
GLOB_MARK
Specifies that each pathname that is a directory should have a / (slash)
appended.
GLOB_NOCHECK
If the pattern parameter does not match any pathname, causes the glob( ) func-
tion to return a list consisting only of the pattern parameter, and the number of
matched patterns is 1.
GLOB_NOESCAPE
Indicates that a \ (backslash) cannot be used to escape metacharacters.
GLOB_NOSORT
Specifies that the list of pathnames need not be sorted. If the GLOB_NOSORT
flag is not set, pathnames are sorted according to the current locale.
The GLOB_APPEND flag can be used to append a new set of pathnames to those found in a
previous call to the glob( ) function. The following rules apply when two or more calls to the
glob( ) function are made with the same value of the pglob parameter and without intervening
calls to the glob( ) function:
The first call to the glob( ) function must not set GLOB_APPEND.
If the application set the GLOB_DOOFFS flag in the first call to the glob( ) function,
then the flag is also set in the second call, and the value of the gl_o
f
fs field of the struc-
ture pointed to by the pglob parameter is not modified between the calls.
527187-017 Hewlett-Packard Company 3161