fnmatch.h(7POSIX)

πŸ¦‹ fnmatch.h(7POSIX) β€” bestie edition πŸ¦‹

okay so you just opened the manual page for fnmatch.h, which lives in the POSIX Programmer's Manual. Pull up a chair, grab a strawberry πŸ“, we're doing this.


πŸ’« PROLOG πŸ’«

Real talk first: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so like, go consult the corresponding Linux manual page for the deets on Linux behavior, iykyk), or β€” and this is the part nobody likes β€” the interface may not be implemented on Linux at all. 😭


✨ NAME ✨

fnmatch.h β€” the header that gives you filename-matching types. That's the whole vibe. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <fnmatch.h>

That's it. That's the entrance. 🫢


πŸ‘‘ DESCRIPTION πŸ‘‘

So the <fnmatch.h> header shall define the following symbolic constants. Not "might", not "could" β€” shall. Periodt.

  • FNM_NOMATCH β€” the string does not match the specified pattern. The classic "it's giving no". πŸ’€
  • FNM_PATHNAME β€” a <slash> in the string only matches a <slash> in the pattern. Slash matches slash, no crossover episodes. πŸ”₯
  • FNM_PERIOD β€” a leading <period> in the string must be exactly matched by a <period> in the pattern. No sneaky wildcards sneaking past that dot. πŸ™ˆ
  • FNM_NOESCAPE β€” disables backslash escaping. Backslashes lose their powers, sorry bestie. ✨

And then, the following shall be declared as a function and may also be defined as a macro. Either way, a function prototype shall be provided:

int fnmatch(const char *, const char *, int);

Look at that signature. Iconic. πŸ‘‘

The following sections are informative, meaning they're the ~bonus content~. 🌈


🌸 APPLICATION USAGE 🌸

None.

(Yes really. Nothing. We love a low-effort queen.) πŸ’…


🧚 RATIONALE 🧚

None.

(Also nothing. The rationale said "no thoughts, head empty". πŸŽ€)


⭐ FUTURE DIRECTIONS ⭐

None.

(Third one. The trilogy of nothing. Slay.) 😌


πŸ’– SEE ALSO πŸ’–

The System Interfaces volume of POSIX.1‐2017, fnmatch(). Go read that one next, bestie, that's where the actual matching happens. πŸ¦‹


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.

So basically: 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 β€” it's the main character, this page is just the understudy. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Also, 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. Not the standard's fault, not mine, it's the conversion pipeline's. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html . 🫢


okay bye bestie, go match some filenames πŸ’–βœ¨ β€” this page came to you courtesy of IEEE/The Open Group, 2017, and it's the fnmatch.h(7POSIX) page, no cap. πŸŽ€πŸ¦‹