]>
Commit | Line | Data |
---|---|---|
bf5a7247 | 1 | .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) |
fea681da MK |
2 | .\" |
3 | .\" Permission is granted to make and distribute verbatim copies of this | |
4 | .\" manual provided the copyright notice and this permission notice are | |
5 | .\" preserved on all copies. | |
6 | .\" | |
7 | .\" Permission is granted to copy and distribute modified versions of this | |
8 | .\" manual under the conditions for verbatim copying, provided that the | |
9 | .\" entire resulting derived work is distributed under the terms of a | |
10 | .\" permission notice identical to this one. | |
c13182ef | 11 | .\" |
fea681da MK |
12 | .\" Since the Linux kernel and libraries are constantly changing, this |
13 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
14 | .\" responsibility for errors or omissions, or for damages resulting from | |
15 | .\" the use of the information contained herein. The author(s) may not | |
16 | .\" have taken the same level of care in the production of this manual, | |
17 | .\" which is licensed free of charge, as they might when working | |
18 | .\" professionally. | |
c13182ef | 19 | .\" |
fea681da MK |
20 | .\" Formatted or processed versions of this manual, if unaccompanied by |
21 | .\" the source, must acknowledge the copyright and authors of this work. | |
22 | .\" License. | |
23 | .\" Modified Sat Jul 24 19:35:54 1993 by Rik Faith (faith@cs.unc.edu) | |
24 | .\" Modified Mon Oct 16 00:16:29 2000 following Joseph S. Myers | |
25 | .\" | |
26 | .TH FNMATCH 3 2000-10-15 "GNU" "Linux Programmer's Manual" | |
27 | .SH NAME | |
28 | fnmatch \- match filename or pathname | |
29 | .SH SYNOPSIS | |
30 | .nf | |
31 | .B #include <fnmatch.h> | |
32 | .sp | |
33 | .BI "int fnmatch(const char *" "pattern" ", const char *" string ", int " flags ); | |
34 | .fi | |
35 | .SH DESCRIPTION | |
36 | The | |
63aa9df0 | 37 | .BR fnmatch () |
fea681da MK |
38 | function checks whether the |
39 | .I string | |
40 | argument matches the | |
41 | .I pattern | |
42 | argument, which is a shell wildcard pattern. | |
43 | .PP | |
44 | The | |
45 | .I flags | |
d9bfdb9c | 46 | argument modifies the behavior; it is the bitwise OR of zero or more |
fea681da MK |
47 | of the following flags: |
48 | .TP | |
49 | .B FNM_NOESCAPE | |
50 | If this flag is set, treat backslash as an ordinary character, | |
51 | instead of an escape character. | |
52 | .TP | |
53 | .B FNM_PATHNAME | |
54 | If this flag is set, match a slash in | |
55 | .I string | |
56 | only with a slash in | |
57 | .I pattern | |
c13182ef | 58 | and not by an asterisk (*) or a question mark (?) metacharacter, |
73dc32f0 | 59 | nor by a bracket expression ([]) containing a slash. |
fea681da MK |
60 | .TP |
61 | .B FNM_PERIOD | |
62 | If this flag is set, a leading period in | |
63 | .I string | |
64 | has to be matched exactly by a period in | |
65 | .IR pattern . | |
66 | A period is considered to be leading if it is the first character in | |
67 | .IR string , | |
68 | or if both | |
c13182ef | 69 | .B FNM_PATHNAME |
fea681da MK |
70 | is set and the period immediately follows a slash. |
71 | .TP | |
72 | .B FNM_FILE_NAME | |
73 | This is a GNU synonym for \fBFNM_PATHNAME\fR. | |
74 | .TP | |
75 | .B FNM_LEADING_DIR | |
76 | If this flag (a GNU extension) is set, the pattern is considered to be | |
77 | matched if it matches an initial segment of | |
78 | .I string | |
c13182ef MK |
79 | which is followed by a slash. |
80 | This flag is mainly for the internal | |
fea681da MK |
81 | use of glibc and is only implemented in certain cases. |
82 | .TP | |
83 | .B FNM_CASEFOLD | |
84 | If this flag (a GNU extension) is set, the pattern is matched | |
85 | case-insensitively. | |
47297adb | 86 | .SH RETURN VALUE |
fea681da MK |
87 | Zero if |
88 | .I string | |
89 | matches | |
90 | .IR pattern , | |
91 | .B FNM_NOMATCH | |
c7094399 | 92 | if there is no match or another nonzero value if there is an error. |
47297adb | 93 | .SH CONFORMING TO |
c13182ef | 94 | POSIX.2. |
68e1685c | 95 | The |
fea681da MK |
96 | .BR FNM_FILE_NAME ", " FNM_LEADING_DIR ", and " FNM_CASEFOLD |
97 | flags are GNU extensions. | |
47297adb | 98 | .SH SEE ALSO |
fea681da MK |
99 | .BR sh (1), |
100 | .BR glob (3), | |
101 | .BR scandir (3), | |
2ff9c803 | 102 | .BR wordexp (3), |
fea681da | 103 | .BR glob (7) |