reference/filesystem/functions/glob.xml
850ac483c876e767048222f9133e2498145f9f4a
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.glob">
3
+
<refentry xml:id="function.glob" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
4
4
<refnamediv>
5
5
<refname>glob</refname>
6
6
<refpurpose>Find pathnames matching a pattern</refpurpose>
...
...
@@ -9,7 +9,7 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>array</type><methodname>glob</methodname>
12
+
<type class="union"><type>array</type><type>false</type></type><methodname>glob</methodname>
13
13
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
14
14
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam>
15
15
</methodsynopsis>
...
...
@@ -31,60 +31,47 @@
31
31
<para>
32
32
The pattern. No tilde expansion or parameter substitution is done.
33
33
</para>
34
-
</listitem>
35
-
</varlistentry>
36
-
<varlistentry>
37
-
<term><parameter>flags</parameter></term>
38
-
<listitem>
39
34
<para>
40
-
Valid flags:
35
+
Special characters:
41
36
<itemizedlist>
42
37
<listitem>
43
38
<simpara>
44
-
<constant>GLOB_MARK</constant> - Adds a slash to each directory returned
45
-
</simpara>
46
-
</listitem>
47
-
<listitem>
48
-
<simpara>
49
-
<constant>GLOB_NOSORT</constant> - Return files as they appear in the
50
-
directory (no sorting). When this flag is not used, the pathnames are
51
-
sorted alphabetically
52
-
</simpara>
53
-
</listitem>
54
-
<listitem>
55
-
<simpara>
56
-
<constant>GLOB_NOCHECK</constant> - Return the search pattern if no
57
-
files matching it were found
58
-
</simpara>
59
-
</listitem>
60
-
<listitem>
61
-
<simpara>
62
-
<constant>GLOB_NOESCAPE</constant> - Backslashes do not quote
63
-
metacharacters
39
+
<literal>*</literal> - Matches zero or more characters.
64
40
</simpara>
65
41
</listitem>
66
42
<listitem>
67
43
<simpara>
68
-
<constant>GLOB_BRACE</constant> - Expands {a,b,c} to match 'a', 'b',
69
-
or 'c'
44
+
<literal>?</literal> - Matches exactly one character (any character).
70
45
</simpara>
71
46
</listitem>
72
47
<listitem>
73
48
<simpara>
74
-
<constant>GLOB_ONLYDIR</constant> - Return only directory entries
75
-
which match the pattern
49
+
<literal>[...]</literal> - Matches one character from a group of
50
+
characters. If the first character is <literal>!</literal>,
51
+
matches any character not in the group.
76
52
</simpara>
77
53
</listitem>
78
54
<listitem>
79
55
<simpara>
80
-
<constant>GLOB_ERR</constant> - Stop on read errors (like unreadable
81
-
directories), by default errors are ignored.
56
+
<literal>\</literal> - Escapes the following character,
57
+
except when the <constant>GLOB_NOESCAPE</constant> flag is used.
82
58
</simpara>
83
59
</listitem>
84
60
</itemizedlist>
85
61
</para>
86
62
</listitem>
87
63
</varlistentry>
64
+
<varlistentry>
65
+
<term><parameter>flags</parameter></term>
66
+
<listitem>
67
+
<para>
68
+
Valid flags:
69
+
<variablelist>
70
+
<xi:include set-xml-id="" xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('constant.glob-constant-variablelist')/*)"><xi:fallback/></xi:include>
71
+
</variablelist>
72
+
</para>
73
+
</listitem>
74
+
</varlistentry>
88
75
</variablelist>
89
76
</para>
90
77
</refsect1>
...
...
@@ -103,30 +90,6 @@
103
90
</note>
104
91
</refsect1>
105
92

106
-
<refsect1 role="changelog">
107
-
&reftitle.changelog;
108
-
<para>
109
-
<informaltable>
110
-
<tgroup cols="2">
111
-
<thead>
112
-
<row>
113
-
<entry>&Version;</entry>
114
-
<entry>&Description;</entry>
115
-
</row>
116
-
</thead>
117
-
<tbody>
118
-
<row>
119
-
<entry>5.1.0</entry>
120
-
<entry>
121
-
<constant>GLOB_ERR</constant> was added
122
-
</entry>
123
-
</row>
124
-
</tbody>
125
-
</tgroup>
126
-
</informaltable>
127
-
</para>
128
-
</refsect1>
129
-

130
93
<refsect1 role="examples">
131
94
&reftitle.examples;
132
95
<para>
...
...
@@ -164,12 +127,6 @@ quickref.txt size 137820
164
127
This function isn't available on some systems (e.g. old Sun OS).
165
128
</simpara>
166
129
</note>
167
-
<note>
168
-
<simpara>
169
-
The <constant>GLOB_BRACE</constant> flag is not available on some non GNU
170
-
systems, like Solaris.
171
-
</simpara>
172
-
</note>
173
130
</refsect1>
174
131

175
132
<refsect1 role="seealso">
...
...
@@ -185,7 +142,6 @@ quickref.txt size 137820
185
142
</refsect1>
186
143

187
144
</refentry>
188
-

189
145
<!-- Keep this comment at the end of the file
190
146
Local variables:
191
147
mode: sgml
192
148