-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathglob.xml
166 lines (159 loc) · 4.91 KB
/
glob.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 07e4b982a4097d894d8576ab793f3cf18759983d Maintainer: hirokawa Status: ready -->
<!-- CREDITS: shimooka,mumumu -->
<refentry xml:id="function.glob" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
<refnamediv>
<refname>glob</refname>
<refpurpose>パターンにマッチするパス名を探す</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type class="union"><type>array</type><type>false</type></type><methodname>glob</methodname>
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam>
</methodsynopsis>
<para>
<function>glob</function> 関数は libc の glob()
関数で使われるルールに基づいて
<parameter>pattern</parameter> にマッチする全てのパス名を検索します。
ルールは、一般のシェルで使われるルールと似ています。
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>pattern</parameter></term>
<listitem>
<para>
パターン。チルダの展開やパラメータ置換は行いません。
</para>
<para>
Special characters:
<itemizedlist>
<listitem>
<simpara>
<literal>*</literal> - ゼロ文字以上の文字にマッチします。
</simpara>
</listitem>
<listitem>
<simpara>
<literal>?</literal> - 正確に(任意の)一文字にだけマッチします。
</simpara>
</listitem>
<listitem>
<simpara>
<literal>[...]</literal> - グループ化された文字のうち、一文字にマッチします。
はじめの文字が <literal>!</literal> だった場合、
グループにないあらゆる文字にマッチします。
</simpara>
</listitem>
<listitem>
<simpara>
<literal>\</literal> - 次に来る文字をエスケープします。
但し、<constant>GLOB_NOESCAPE</constant> が使われている場合は除きます。
</simpara>
</listitem>
</itemizedlist>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>flags</parameter></term>
<listitem>
<para>
有効なフラグは次のとおりです。
<variablelist>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('constant.glob-constant-variablelist')/*)"><xi:fallback/></xi:include>
</variablelist>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
マッチするファイル/ディレクトリを含む配列を返します。
マッチするファイルがなかった場合には空の配列、
そして失敗した場合には &false; を返します。
</para>
<note>
<para>
システムによっては、何もマッチしなかった場合とエラーが発生した場合を区別できないものもあります。
</para>
</note>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>
<function>glob</function> が <function>opendir</function>
と関連する関数群の代替策になるかを示す簡便な方法
</title>
<programlisting role="php">
<![CDATA[
<?php
foreach (glob("*.txt") as $filename) {
echo "$filename size " . filesize($filename) . "\n";
}
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
funclist.txt size 44686
funcsummary.txt size 267625
quickref.txt size 137820
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
¬e.no-remote;
<note>
<simpara>
この関数が使用できないシステムも存在します (例: 昔の Sun OS など)。
</simpara>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>opendir</function></member>
<member><function>readdir</function></member>
<member><function>closedir</function></member>
<member><function>fnmatch</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->