glob.h(0P)
glob.h โ pathname pattern-matching types ๐ โจ
okay bestie, so this page is from the POSIX Programmer's Manual (that's the glob.h(0P) joint right there in the corner ๐). Real talk though: the Linux implementation of this interface may differ โ so if you're on Linux, go peek at the corresponding Linux manual page for the actual deets โ or honestly the interface might not even be implemented on Linux at all. ๐
๐ธ PROLOG ๐ธ
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.
๐ NAME ๐
glob.h โ pathname pattern-matching types. that's it, that's the name, iconic.
โจ SYNOPSIS โจ
#include <glob.h>
๐ DESCRIPTION ๐
So the <glob.h> header shall define the structures and symbolic constants that the glob() function uses. it's giving "support system for the main character" fr fr.
The <glob.h> header shall define the glob_t structure type, which shall include at least these members:
size_t gl_pathc Count of paths matched by pattern.
char **gl_pathv Pointer to a list of matched pathnames.
size_t gl_offs Slots to reserve at the beginning of gl_pathv.
gl_pathcโ count of paths matched by pattern. the headcount bestie ๐gl_pathvโ pointer to a list of matched pathnames. the actual roster โจgl_offsโ slots to reserve at the beginning ofgl_pathv. like saving seats at the front of the row ๐ซถ
The <glob.h> header shall define the size_t type as described in <sys/types.h>. yes, that <sys/types.h>, the one you already know and love ๐
The <glob.h> header shall define the following symbolic constants as values for the flags argument:
GLOB_APPENDโ append generated pathnames to those previously obtained. not me just adding to the pile ๐GLOB_DOOFFSโ specify how many null pointers to add to the beginning ofgl_pathv. blank slots at the start, periodt.GLOB_ERRโ causeglob()to return on error. no patience, we're leaving ๐โโ๏ธGLOB_MARKโ each pathname that is a directory that matches pattern has a<slash>appended. directory girls get a little accessory ๐GLOB_NOCHECKโ if pattern does not match any pathname, then return a list consisting of only pattern. if nobody shows up, at least you showed up for yourself ๐ญGLOB_NOESCAPEโ disable backslash escaping. backslash, you are OFF the team.GLOB_NOSORTโ do not sort the pathnames returned. chaotic order, we don't gatekeep ๐ฆ
The <glob.h> header shall define the following symbolic constants as error return values:
GLOB_ABORTEDโ the scan was stopped becauseGLOB_ERRwas set or(*errfunc)()returned non-zero.GLOB_NOMATCHโ the pattern does not match any existing pathname, andGLOB_NOCHECKwas not set in flags.GLOB_NOSPACEโ an attempt to allocate memory failed. bestie ran out of room, it happens ๐ญ
The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.
int glob(const char *restrict, int, int(*)(const char *, int),
glob_t *restrict);
void globfree(glob_t *);
The following sections are informative. (translation: the lore is optional, the facts above were not ๐)
๐ APPLICATION USAGE ๐
None.
๐ญ RATIONALE ๐ญ
None.
๐ฎ FUTURE DIRECTIONS ๐ฎ
None.
๐ SEE ALSO ๐
<sys_types.h>- The System Interfaces volume of POSIX.1โ2017,
glob()
๐ COPYRIGHT ๐
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
and that's the whole page bestie, no cap ๐ซถ this came to you courtesy of IEEE/The Open Group, dated 2017, and it lives under the name glob.h(0P). go match some patterns, you ate ๐
โจ๐
๐ฆ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 ยท custom
- alpine 3.23: man-pages-posix 2017a-r0 ยท custom
- alpine 3.24: man-pages-posix 2017a-r0 ยท custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 ยท SUSE-IEEE
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms