FNMATCH

Section: Linux Programmer's Manual (3)
Updated: April 19, 1993
Index Return to Main Contents
 

NAME

fnmatch - match filename or pathname  

SYNOPSIS

#include <fnmatch.h>

int fnmatch(const char *pattern, const char *strings, int flags);
 

DESCRIPTION

The fnmatch() checks the strings argument and checks if it matches pattern argument, which is a shell wildcard pattern.

The flags argument modifies the behaviour; it is the bitwise OR of zero or more of the following flags:

FNM_NOESCAPE
If this flag is set, treat backslash as an ordinary character, instead of an escape character.
FNM_PATHNAME
If this flag is set, match a slash in string only with a slash in pattern and not, for example, with a [] - sequence containing a slash.
FNM_PERIOD
If flag this is set, a leading period in string has to be matched exactly by a period in pattern. A period is considered to be leading if it is the first character in string, or if both FNM_PATHNAME is set and the period immediately follows a slash.
 

RETURN VALUE

Zero if string matches pattern, FNM_NOMATCH if there is no match or another value if there is an error.  

CONFORMS TO

proposed POSIX.2  

BUGS

POSIX.2 is not yet an approved standard; the information in this manpage is subject to change.  

SEE ALSO

sh(1), glob(3), glob(7)


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
CONFORMS TO
BUGS
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 12:24:21 GMT, March 22, 2025