Print this page
1209 fnmatch(3C) should mention FNM_IGNORECASE
Reviewed by: Marcel Telka <marcel@telka.sk>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3c/fnmatch.3c.man.txt
+++ new/usr/src/man/man3c/fnmatch.3c.man.txt
1 1 FNMATCH(3C) Standard C Library Functions FNMATCH(3C)
2 2
3 3
4 4
5 5 NAME
6 6 fnmatch - match filename or path name
7 7
8 8 SYNOPSIS
9 9 #include <fnmatch.h>
10 10
11 11 int fnmatch(const char *pattern, const char *string, int flags);
12 12
13 13
14 14 DESCRIPTION
15 15 The fnmatch() function matches patterns as described on the fnmatch(5)
16 16 manual page. It checks the string argument to see if it matches the
17 17 pattern argument.
18 18
19 19
20 20 The flags argument modifies the interpretation of pattern and string.
21 21 It is the bitwise inclusive OR of zero or more of the following flags
22 22 defined in the header <fnmatch.h>.
23 23
24 24 FNM_PATHNAME
↓ open down ↓ |
24 lines elided |
↑ open up ↑ |
25 25 If set, a slash (/) character in string will be
26 26 explicitly matched by a slash in pattern; it will not
27 27 be matched by either the asterisk (*) or question-mark
28 28 (?) special characters, nor by a bracket ([])
29 29 expression.
30 30
31 31 If not set, the slash character is treated as an
32 32 ordinary character.
33 33
34 34
35 + FNM_IGNORECASE
36 + If set, the string will be transliterated to lower
37 + case before doing the actual match. This
38 + transliteration is done using towlower_l(3C), using
39 + the locale of the current thread. If no locale is
40 + set, then the global locale is used instead.
41 +
42 + If not set, the match will use string with no
43 + changes, making the match case-sensitive.
44 +
45 +
35 46 FNM_NOESCAPE
36 47 If not set, a backslash character (\) in pattern
37 48 followed by any other character will match that
38 49 second character in string. In particular, "\\" will
39 50 match a backslash in string.
40 51
41 52 If set, a backslash character will be treated as an
42 53 ordinary character.
43 54
44 55
45 56 FNM_PERIOD
46 57 If set, a leading period in string will match a
47 58 period in pattern; where the location of "leading" is
48 59 indicated by the value of FNM_PATHNAME:
49 60
↓ open down ↓ |
5 lines elided |
↑ open up ↑ |
50 61 o If FNM_PATHNAME is set, a period is
51 62 "leading" if it is the first character in
52 63 string or if it immediately follows a
53 64 slash.
54 65
55 66 o If FNM_PATHNAME is not set, a period is
56 67 "leading" only if it is the first
57 68 character of string.
58 69
59 70
71 + If not set, no special restrictions are placed on
72 + matching a period.
60 73
61 - If not set, no special restrictions are placed on matching a period.
62 -
63 74 RETURN VALUES
64 75 If string matches the pattern specified by pattern, then fnmatch()
65 76 returns 0. If there is no match, fnmatch() returns FNM_NOMATCH, which
66 77 is defined in the header <fnmatch.h>. If an error occurs, fnmatch()
67 78 returns another non-zero value.
68 79
69 80 USAGE
70 81 The fnmatch() function has two major uses. It could be used by an
71 82 application or utility that needs to read a directory and apply a
72 83 pattern against each entry. The find(1) utility is an example of this.
73 84 It can also be used by the pax(1) utility to process its pattern
74 85 operands, or by applications that need to match strings in a similar
75 86 manner.
76 87
77 88
78 89 The name fnmatch() is intended to imply filename match, rather than
79 90 pathname match. The default action of this function is to match
80 91 filenames, rather than path names, since it gives no special
81 92 significance to the slash character. With the FNM_PATHNAME flag,
82 93 fnmatch() does match path names, but without tilde expansion, parameter
83 94 expansion, or special treatment for period at the beginning of a
84 95 filename.
85 96
86 97
87 98 The fnmatch() function can be used safely in multithreaded
88 99 applications, as long as setlocale(3C) is not being called to change
89 100 the locale.
90 101
91 102 ATTRIBUTES
92 103 See attributes(5) for descriptions of the following attributes:
93 104
94 105
95 106
96 107
97 108 +--------------------+-------------------------+
98 109 | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
99 110 +--------------------+-------------------------+
100 111 |CSI | Enabled |
101 112 +--------------------+-------------------------+
102 113 |Interface Stability | Standard |
↓ open down ↓ |
30 lines elided |
↑ open up ↑ |
103 114 +--------------------+-------------------------+
104 115 |MT-Level | MT-Safe with exceptions |
105 116 +--------------------+-------------------------+
106 117
107 118 SEE ALSO
108 119 find(1), pax(1), glob(3C), setlocale(3C), wordexp(3C), attributes(5),
109 120 fnmatch(5), standards(5)
110 121
111 122
112 123
113 - July 24, 2002 FNMATCH(3C)
124 + June 6, 2015 FNMATCH(3C)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX