int glob(const char *pattern, int flags, int (*errfunc)(const char *epath, int eerrno), glob_t *pglob);
|Member Type||Member Name||Description|
|size_t||gl_pathc||Count of paths matched by the specified pattern.|
|char **||gl_pathv||Pointer to a list of matched path names.|
|size_t||gl_offs||Slots to reserve at the beginning of gl_pathv.|
The pattern parameter is
a pointer to a path name pattern to be expanded. The
* ? [
It is the caller's
responsibility to create the structure pointed to by pglob.
The flags argument is used to
control the behavior of
Append path names generated to the ones from a previous call to
Make use of the gl_offs member of pglob. If this flag is set, the gl_offs member is used to specify how many null pointers to add to the beginning of the gl_pathv array. In other words, the gl_pathv array points to gl_offs null pointers, followed by gl_pathcpath name pointers, followed by a null pointer.
glob()to return when it encounters a directory that it cannot open or read. Ordinarily, glob()continues to find matches.
Each path name that is a directory that matches the pattern has a slash appended to the name.
Ignore case when performing pattern matching and sorting.
If the specified pattern does not match any path name,
glob()returns a list consisting of pattern, and the number of matched path names is 1.
Disable backspace escaping.
Do not sort the path name list. The order of the returned path names is unspecified.
The GLOB_APPEND flag can be used to append a new set of
path names to those found in a previous call to
- The first such call must not set GLOB_APPEND. All subsequent calls must set it.
- All the calls must set GLOB_DOOFFS, or all must not set it.
- After the second call, the gl_pathv member points to a list containing the following:
- The count returned in the gl_pathc member is the total number of path names from the two calls.
- The application can change any of the fields after a call to
glob(). If it does, it must reset them to the original value before a subsequent call, using the same pglob value, to globfree()or to glob()with the GLOB_APPEND flag.
If, during the search, a directory is encountered that cannot be opened
or read, and errfunc is not a null pointer,
- The epath parameter is a pointer to the path that failed.
- The eerrno parameter is the value of errno
from the failure, as set by
opendir(), readdir(), or stat().
Points to the path name pattern to be expanded.
Controls the behavior of
glob(). The value of flags is defined in the DESCRIPTION section.
Points to a function to be called on error, as defined in the DESCRIPTION section.
Points to the structure that the caller created. This structure must be passed to
globfree()to release storage allocated by glob().
If successful, the
The scan was stopped because GLOB_ERR was set or (*
errfunc()) returned non-zero.
The pattern does not match any existing path name, and GLOB_NOCHECK was not set in flags.
An attempt to allocate memory failed.
The GLOB_NOCASE flag was added because file names are case-insensitive on Windows.
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
PTC MKS Toolkit 10.1 Documentation Build 15.