Matches a filename or a pathname.
#include <fnmatch.h> int fnmatch ( const char *pattern, const char *string, int flags);
(IN) Points to a string with the wildcard pattern to match.
(IN) Points to the string to see if it matches the specified pattern.
(IN) Specifies how to perform the match, using the following flags which can be ORed:
If the string matches the specified pattern, returns 0. If the string and pattern do not match, returns FNM_NOMATCH (-1). If an error occurs, returns a nonzero value.
The pattern parameter can use the following wildcards:
The fnmatch function is not fully POSIX compliant because fnmatch ignores case when performing matches. To make it POSIX compliant, you must link your code with the LD_WANT_POSIX_SEMANTICS (0x00400000) flag. The fnmatch function then performs case-sensitive matches unless the flags parameter is set to FNM_CASEFOLD, which allows it to ignore case.
IMPORTANT:The LD_WANT_POSIX_SEMANTICS flag is experimental and not fully supported until NetWare 5.1 SP8, NetWare 6.1 SP5, and NetWare 6.5 SP2. For more information about linker flags, see Section 1.6, Using a Linker Definition File.