OSDN Git Service

c2b1cac7fb07a2275e815a00ca26af3b12dfb889
[linuxjm/LDP_man-pages.git] / draft / man3 / fts.3
1 .\"     $NetBSD: fts.3,v 1.13.2.1 1997/11/14 02:09:32 mrg Exp $
2 .\"
3 .\" Copyright (c) 1989, 1991, 1993, 1994
4 .\"     The Regents of the University of California.  All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\" 3. All advertising materials mentioning features or use of this software
15 .\"    must display the following acknowledgement:
16 .\"     This product includes software developed by the University of
17 .\"     California, Berkeley and its contributors.
18 .\" 4. Neither the name of the University nor the names of its contributors
19 .\"    may be used to endorse or promote products derived from this software
20 .\"    without specific prior written permission.
21 .\"
22 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" SUCH DAMAGE.
33 .\"
34 .\"     @(#)fts.3       8.5 (Berkeley) 4/16/94
35 .\"
36 .\" 2007-12-08, mtk, Converted from mdoc to man macros
37 .\"
38 .\" Japanese Version Copyright (c) 2000 Yuichi SATO
39 .\"         all rights reserved.
40 .\" Translated Tue Jul 11 19:02:58 JST 2000
41 .\"         by Yuichi SATO <sato@complex.eng.hokudai.ac.jp>
42 .\"
43 .\"WORD:        hierarchy               階層
44 .\"WORD:        traverse                たどる
45 .\"WORD:        pointer                 ポインタ
46 .\"WORD:        restore                 復元する
47 .\"WORD:        null-terminated         NULL 終端された
48 .\"
49 .TH FTS 3 2007-12-28 "Linux" "Linux Programmer's Manual"
50 .\"O .SH NAME
51 .SH 名前
52 .\"O fts, fts_open, fts_read, fts_children, fts_set, fts_close \- \
53 .\"O traverse a file hierarchy
54 fts, fts_open, fts_read, fts_children, fts_set, fts_close \- \
55 ファイル階層をたどる
56 .\"O .SH SYNOPSIS
57 .SH 書式
58 .nf
59 .B #include <sys/types.h>
60 .B #include <sys/stat.h>
61 .B #include <fts.h>
62 .sp
63 .BI "FTS *fts_open(char * const *" path_argv ", int " options ", "
64 .BI "              int (*" compar ")(const FTSENT **, const FTSENT **));"
65 .sp
66 .BI "FTSENT *fts_read(FTS *" ftsp );
67 .sp
68 .BI "FTSENT *fts_children(FTS *" ftsp ", int " options );
69 .sp
70 .BI "int fts_set(FTS *" ftsp ", FTSENT *" f ", int " options );
71 .sp
72 .BI "int fts_close(FTS *" ftsp );
73 .fi
74 .\"O .SH DESCRIPTION
75 .SH 説明
76 .\"O The
77 .\"O fts functions are provided for traversing
78 .\"O file hierarchies.
79 .\"O A simple overview is that the
80 .\"O .BR fts_open ()
81 .\"O function returns a "handle" on a file hierarchy, which is then supplied to
82 .\"O the other
83 .\"O fts functions.
84 fts 関数群は、ファイル階層をたどるために提供されている。
85 簡単に概略すると次のようになる。
86 .BR fts_open ()
87 関数は、他の fts 関数群に渡すための、ファイル階層の「ハンドル」を返す。
88 .\"O The function
89 .\"O .BR fts_read ()
90 .\"O returns a pointer to a structure describing one of the files in the file
91 .\"O hierarchy.
92 .\"O The function
93 .\"O .BR fts_children ()
94 .\"O returns a pointer to a linked list of structures, each of which describes
95 .\"O one of the files contained in a directory in the hierarchy.
96 .\"O In general, directories are visited two distinguishable times; in preorder
97 .\"O (before any of their descendants are visited) and in postorder (after all
98 .\"O of their descendants have been visited).
99 .\"O Files are visited once.
100 .\"O It is possible to walk the hierarchy "logically" (ignoring symbolic links)
101 .\"O or physically (visiting symbolic links), order the walk of the hierarchy or
102 .\"O prune and/or revisit portions of the hierarchy.
103 .BR fts_read ()
104 関数は、ファイル階層中にある 1 つのファイルを記述する構造体へのポインタを返す。
105 .BR fts_children ()
106 関数は、階層中のディレクトリにあるファイルを記述する構造体の
107 リンクリストへのポインタを返す。
108 一般にディレクトリは、
109 preorder (正方向:下の階層のディレクトリをたどる前) と
110 postorder (逆方向:下の階層のディレクトリをすべてたどった後) という、
111 異なる方向で 2 回たどられる。ファイルは 1 回たどられる。
112 ディレクトリ階層を「論理的に」(シンボリックリングを無視して) 移動することも、
113 物理的に (シンボリックリンクをたどって) 移動することも可能である。
114 また、階層中の移動の道筋を指示すること・
115 余分なものを取り除くこと・階層の一部を再びたどることが可能である。
116 .PP
117 .\"O Two structures are defined (and typedef'd) in the include file
118 .\"O .IR <fts.h> .
119 .\"O The first is
120 .\"O .IR FTS ,
121 .\"O the structure that represents the file hierarchy itself.
122 .\"O The second is
123 .\"O .IR FTSENT ,
124 .\"O the structure that represents a file in the file
125 .\"O hierarchy.
126 .\"O Normally, an
127 .\"O .I FTSENT
128 .\"O structure is returned for every file in the file
129 .\"O hierarchy.
130 .\"O In this manual page, "file" and
131 .\"O "FTSENT structure"
132 .\"O are generally interchangeable.
133 .\"O The
134 .\"O .I FTSENT
135 .\"O structure contains at least the following fields, which are
136 .\"O described in greater detail below:
137 2 つの構造体がインクルードファイル
138 .I <fts.h>
139 で定義されている (さらに typedef されている)。
140 1 つ目は、ファイル階層そのものを表現する
141 .I FTS
142 構造体である。
143 2 つ目は、ファイル階層中のファイルを表現する
144 .I FTSENT
145 構造体である。
146 .I FTSENT
147 構造体は通常、ファイル階層中のすべてのファイルに対して返される。
148 この man ページでは、「ファイル」と
149 .RI 「 FTSENT
150 構造体」を一般に読み変えることができる。
151 .I FTSENT
152 構造体は、少なくとも次のようなフィールドを持っており、
153 以下でより詳しく説明されている。
154 .in +4n
155 .nf
156
157 .\"O typedef struct _ftsent {
158 .\"O     unsigned short fts_info;     /* flags for FTSENT structure */
159 .\"O     char          *fts_accpath;  /* access path */
160 .\"O     char          *fts_path;     /* root path */
161 .\"O     short          fts_pathlen;  /* strlen(fts_path) */
162 .\"O     char          *fts_name;     /* filename */
163 .\"O     short          fts_namelen;  /* strlen(fts_name) */
164 .\"O     short          fts_level;    /* depth (\-1 to N) */
165 .\"O     int            fts_errno;    /* file errno */
166 .\"O     long           fts_number;   /* local numeric value */
167 .\"O     void          *fts_pointer;  /* local address value */
168 .\"O     struct ftsent *fts_parent;   /* parent directory */
169 .\"O     struct ftsent *fts_link;     /* next file structure */
170 .\"O     struct ftsent *fts_cycle;    /* cycle structure */
171 .\"O     struct stat   *fts_statp;    /* stat(2) information */
172 .\"O } FTSENT;
173 typedef struct _ftsent {
174     unsigned short fts_info;     /* FTSENT 構造体のためのフラグ */
175     char          *fts_accpath;  /* アクセスパス */
176     char          *fts_path;     /* ルートパス */
177     short          fts_pathlen;  /* fts_path の長さ */
178     char          *fts_name;     /* ファイル名 */
179     short          fts_namelen;  /* fts_name の長さ */
180     short          fts_level;    /* 深さ (\-1 〜 N) */
181     int            fts_errno;    /* ファイルのエラー番号 */
182     long           fts_number;   /* ローカルな番号 */
183     void          *fts_pointer;  /* ローカルなアドレス番号 */
184     struct ftsent *fts_parent;   /* 親ディレクトリ */
185     struct ftsent *fts_link;     /* 次のファイル構造体 */
186     struct ftsent *fts_cycle;    /* 循環している構造体 */
187     struct stat   *fts_statp;    /* stat(2) の情報 */
188 } FTSENT;
189 .fi
190 .in
191 .PP
192 .\"O These fields are defined as follows:
193 これらのフィールドは、次のように定義されている。
194 .\" .Bl -tag -width "fts_namelen"
195 .TP 12
196 .IR fts_info
197 .\"O One of the following flags describing the returned
198 .\"O .I FTSENT
199 .\"O structure and
200 .\"O the file it represents.
201 .\"O With the exception of directories without errors
202 .\"O .RB ( FTS_D ),
203 .\"O all of these
204 .\"O entries are terminal, that is, they will not be revisited, nor will any
205 .\"O of their descendants be visited.
206 このフィールドは、返された
207 .I FTSENT
208 構造体とファイルを説明する以下のフラグのいずれかを表している。
209 エラーのないディレクトリ
210 .RB ( FTS_D ),
211 の場合は例外として、それ以外のすべてのエントリは終端である。
212 つまり、エントリは再びたどられることもなく、
213 それより下の階層がたどられることもない。
214 .\" .Bl  -tag -width FTS_DEFAULT
215 .RS 12
216 .TP 12
217 .BR FTS_D
218 .\"O A directory being visited in preorder.
219 preorder でたどられるディレクトリ。
220 .TP
221 .BR FTS_DC
222 .\"O A directory that causes a cycle in the tree.
223 .\"O (The
224 .\"O .I fts_cycle
225 .\"O field of the
226 .\"O .I FTSENT
227 .\"O structure will be filled in as well.)
228 ツリーの中で循環しているディレクトリ。
229 .RI ( FTSENT
230 構造体の
231 .I fts_cycle
232 フィールドも同様に埋められる。)
233 .TP
234 .BR FTS_DEFAULT
235 .\"O Any
236 .\"O .I FTSENT
237 .\"O structure that represents a file type not explicitly described
238 .\"O by one of the other
239 .\"O .I fts_info
240 .\"O values.
241 ファイルタイプを表現する
242 .I FTSENT
243 構造体が、
244 .I fts_info
245 の他のいずれかの値で明示的に説明されていない。
246 .TP
247 .BR FTS_DNR
248 .\"O A directory which cannot be read.
249 .\"O This is an error return, and the
250 .\"O .I fts_errno
251 .\"O field will be set to indicate what caused the error.
252 読み込みができないディレクトリ。
253 これはエラーの場合の返り値であり、
254 何がエラーを起こしたかを示すために
255 .I fts_errno
256 フィールドが設定される。
257 .TP
258 .BR FTS_DOT
259 .\"O A file named
260 .\"O "."
261 .\"O or
262 .\"O ".."
263 .\"O which was not specified as a filename to
264 .\"O .BR fts_open ()
265 .\"O (see
266 .\"O .BR FTS_SEEDOT ).
267 .BR fts_open ()
268 へのファイル名として指定されなかった
269 "." または ".."
270 という名前のファイル
271 .RB ( FTS_SEEDOT
272 を参照すること)。
273 .TP
274 .BR FTS_DP
275 .\"O A directory being visited in postorder.
276 .\"O The contents of the
277 .\"O .I FTSENT
278 .\"O structure will be unchanged from when
279 .\"O it was returned in preorder, that is, with the
280 .\"O .I fts_info
281 .\"O field set to
282 .\"O .BR FTS_D .
283 postorder でたどられるディレクトリ。
284 .I FTSENT
285 構造体の内容は、preorder のときに返された状態
286 (つまり、
287 .I fts_info
288 フィールドが
289 .B FTS_D
290 に設定されている状態) から変更されない。
291 .TP
292 .B FTS_ERR
293 .\"O This is an error return, and the
294 .\"O .I fts_errno
295 .\"O field will be set to indicate what caused the error.
296 これはエラーの場合の返り値であり、
297 .I fts_errno
298 フィールドは、何がエラーを起こしたかを示す値に設定される。
299 .TP
300 .B FTS_F
301 .\"O A regular file.
302 通常のファイル。
303 .TP
304 .B FTS_NS
305 .\"O A file for which no
306 .\"O .BR stat (2)
307 .\"O information was available.
308 .\"O The contents of the
309 .\"O .I fts_statp
310 .\"O field are undefined.
311 .\"O This is an error return, and the
312 .\"O .I fts_errno
313 .\"O field will be set to indicate what caused the error.
314 .BR stat (2)
315 情報が得られなかったファイル。
316 .I fts_statp
317 フィールドの内容は定義されない。
318 これはエラーの場合の返り値であり、
319 .I fts_errno
320 フィールドは、何がエラーを起こしたかを示す値に設定される。
321 .TP
322 .B FTS_NSOK
323 .\"O A file for which no
324 .\"O .BR stat (2)
325 .\"O information was requested.
326 .\"O The contents of the
327 .\"O .I fts_statp
328 .\"O field are undefined.
329 .BR stat (2)
330 情報が要求されなかったファイル。
331 .I fts_statp
332 フィールドの内容は定義されない。
333 .TP
334 .B FTS_SL
335 .\"O A symbolic link.
336 シンボリックリンク。
337 .TP
338 .B FTS_SLNONE
339 .\"O A symbolic link with a non-existent target.
340 .\"O The contents of the
341 .\"O .I fts_statp
342 .\"O field reference the file characteristic information for the symbolic link
343 .\"O itself.
344 リンク先の存在しないシンボリックリンク。
345 .I fts_statp
346 フィールドの内容は、シンボリックリンクそのもののファイル特性情報を参照する。
347 .\" .El
348 .RE
349 .TP
350 .IR fts_accpath
351 .\"O A path for accessing the file from the current directory.
352 現在のディレクトリからファイルにアクセスするためのパス。
353 .TP
354 .IR fts_path
355 .\"O The path for the file relative to the root of the traversal.
356 .\"O This path contains the path specified to
357 .\"O .BR fts_open ()
358 .\"O as a prefix.
359 階層をたどるときのルートからみたファイルの相対的なパス。
360 このパスには、
361 .BR fts_open ()
362 に指定したパスがプレフィックスとして含まれる。
363 .TP
364 .IR fts_pathlen
365 .\"O The length of the string referenced by
366 .\"O .IR fts_path .
367 .I fts_path
368 で参照される文字列の長さ。
369 .TP
370 .IR fts_name
371 .\"O The name of the file.
372 ファイルの名前。
373 .TP
374 .IR fts_namelen
375 .\"O The length of the string referenced by
376 .\"O .IR fts_name .
377 .I fts_name
378 で参照される文字列の長さ。
379 .TP
380 .IR fts_level
381 .\"O The depth of the traversal, numbered from \-1 to N, where this file
382 .\"O was found.
383 .\"O The
384 .\"O .I FTSENT
385 .\"O structure representing the parent of the starting point (or root)
386 .\"O of the traversal is numbered \-1, and the
387 .\"O .I FTSENT
388 .\"O structure for the root
389 .\"O itself is numbered 0.
390 階層をたどって、このファイルがみつかった深さ。
391 \-1 〜 N の数値で表される。
392 階層をたどるときの出発点 (ルート) の親ディレクトリを表す
393 .I FTSENT
394 構造体では \-1 となる。
395 また、ルート自身の
396 .I FTSENT
397 構造体では 0 になる。
398 .TP
399 .IR fts_errno
400 .\"O Upon return of a
401 .\"O .I FTSENT
402 .\"O structure from the
403 .\"O .BR fts_children ()
404 .\"O or
405 .\"O .BR fts_read ()
406 .\"O functions, with its
407 .\"O .I fts_info
408 .\"O field set to
409 .\"O .BR FTS_DNR ,
410 .\"O .B FTS_ERR
411 .\"O or
412 .\"O .BR FTS_NS ,
413 .\"O the
414 .\"O .I fts_errno
415 .\"O field contains the value of the external variable
416 .\"O .I errno
417 .\"O specifying the cause of the error.
418 .\"O Otherwise, the contents of the
419 .\"O .I fts_errno
420 .\"O field are undefined.
421 関数
422 .BR fts_children ()
423
424 .BR fts_read ()
425 から返される
426 .I FTSENT
427 構造体の
428 .I fts_info
429 フィールドが
430 .BR FTS_DNR ,
431 .BR FTS_ERR ,
432 .B FTS_NS
433 に設定されている場合、
434 .I fts_errno
435 フィールドにはエラーの原因を示す外部変数
436 .I errno
437 の値が入る。
438 それ以外の場合、
439 .I fts_errno
440 フィールドの内容は定義されない。
441 .TP
442 .IR fts_number
443 .\"O This field is provided for the use of the application program and is
444 .\"O not modified by the
445 .\"O fts functions.
446 .\"O It is initialized to 0.
447 このフィールドは、アプリケーションプログラムから使用するために提供され、
448 fts 関数群では変更されない。
449 このフィールドは 0 で初期化される。
450 .TP
451 .IR fts_pointer
452 .\"O This field is provided for the use of the application program and is
453 .\"O not modified by the
454 .\"O fts functions.
455 .\"O It is initialized to
456 .\"O .BR NULL .
457 このフィールドは、アプリケーションプログラムから使用するために提供され、
458 fts 関数群では変更されない。
459 このフィールドは
460 .B NULL
461 で初期化される。
462 .TP
463 .IR fts_parent
464 .\"O A pointer to the
465 .\"O .I FTSENT
466 .\"O structure referencing the file in the hierarchy
467 .\"O immediately above the current file, that is, the directory of which this
468 .\"O file is a member.
469 .\"O A parent structure for the initial entry point is provided as well,
470 .\"O however, only the
471 .\"O .IR fts_level ,
472 .\"O .I fts_number
473 .\"O and
474 .\"O .I fts_pointer
475 .\"O fields are guaranteed to be initialized.
476 現在のファイルのすぐ上の階層にあるファイル
477 (つまり、現在のファイルがメンバーになっているディレクトリ) を参照する
478 .I FTSENT
479 構造体へのポインタ。
480 最初の出発点に対しても、親となる構造体は与えられる。
481 しかし、
482 .IR fts_level ,
483 .IR fts_number ,
484 .I fts_pointer
485 フィールドのみの初期化しか保証されない。
486 .TP
487 .IR fts_link
488 .\"O Upon return from the
489 .\"O .BR fts_children ()
490 .\"O function, the
491 .\"O .I fts_link
492 .\"O field points to the next structure in the NULL-terminated linked list of
493 .\"O directory members.
494 .\"O Otherwise, the contents of the
495 .\"O .I fts_link
496 .\"O field are undefined.
497 .BR fts_children ()
498 から返される場合、
499 .I fts_link
500 フィールドはディレクトリメンバーの NUL 終端されたリンクリストの形式で、
501 次の構造体を指し示す。
502 それ以外の場合、
503 .I fts_link
504 フィールドは定義されない。
505 .TP
506 .IR fts_cycle
507 .\"O If a directory causes a cycle in the hierarchy (see
508 .\"O .BR FTS_DC ),
509 .\"O either because
510 .\"O of a hard link between two directories, or a symbolic link pointing to a
511 .\"O directory, the
512 .\"O .I fts_cycle
513 .\"O field of the structure will point to the
514 .\"O .I FTSENT
515 .\"O structure in the hierarchy that references the same file as the current
516 .\"O .I FTSENT
517 .\"O structure.
518 .\"O Otherwise, the contents of the
519 .\"O .I fts_cycle
520 .\"O field are undefined.
521 2 つのディレクトリにハードリンクが張られているため、
522 または、シンボリックリンクがあるディレクトリを指しているために、
523 ディレクトリが循環する階層構造を作っている場合
524 .RB ( FTS_DC
525 を参照)、
526 構造体の
527 .I fts_cycle
528 フィールドは、階層中で現在の
529 .I FTSENT
530 構造体と同じファイルを参照している
531 .I FTSENT
532 構造体を指し示す。
533 それ以外の場合、
534 .I fts_cycle
535 フィールドは定義されない。
536 .TP
537 .IR fts_statp
538 .\"O A pointer to
539 .\"O .BR stat (2)
540 .\"O information for the file.
541 このファイルの
542 .BR stat (2)
543 情報へのポインタ。
544 .\" .El
545 .PP
546 .\"O A single buffer is used for all of the paths of all of the files in the
547 .\"O file hierarchy.
548 .\"O Therefore, the
549 .\"O .I fts_path
550 .\"O and
551 .\"O .I fts_accpath
552 .\"O fields are guaranteed to be
553 .\"O null-terminated
554 .\"O .I only
555 .\"O for the file most recently returned by
556 .\"O .BR fts_read ().
557 .\"O To use these fields to reference any files represented by other
558 .\"O .I FTSENT
559 .\"O structures will require that the path buffer be modified using the
560 .\"O information contained in that
561 .\"O .I FTSENT
562 .\"O structure's
563 .\"O .I fts_pathlen
564 .\"O field.
565 .\"O Any such modifications should be undone before further calls to
566 .\"O .BR fts_read ()
567 .\"O are attempted.
568 .\"O The
569 .\"O .I fts_name
570 .\"O field is always
571 .\"O null-terminated.
572 ファイル階層中のすべてのファイルのパスに対して、
573 ただ 1 つのバッファーが使われる。
574 したがって、
575 .I fts_path
576
577 .I fts_accpath
578 フィールドは、
579 .BR fts_read ()
580 によって返された最も新しいファイルに対して「のみ」
581 NULL 終端されることが保証される。
582 これらのフィールドを、他の
583 .I FTSENT
584 構造体で表現されるファイルを参照するために使うには、
585 .I FTSENT
586 構造体の
587 .I fts_pathlen
588 フィールドにある情報を使ってパスのバッファーを修正する必要がある。
589 これらの修正は、さらに
590 .BR fts_read ()
591 を呼び出そうとする場合には、元に戻しておかなければならない。
592 .I fts_name
593 フィールドは、常に
594 .B NUL
595 終端される。
596 .SS fts_open()
597 .\"O The
598 .\"O .BR fts_open ()
599 .\"O function takes a pointer to an array of character pointers naming one
600 .\"O or more paths which make up a logical file hierarchy to be traversed.
601 .\"O The array must be terminated by a
602 .\"O .B NULL
603 .\"O pointer.
604 .BR fts_open ()
605 関数は、文字列ポインタの配列へのポインタを引き数に取る。
606 この文字列ポインタは、論理ファイル階層をつくる 1 つ以上のパスの名前になる。
607 配列は、
608 .B NULL
609 ポインタで終端されなければならない。
610 .PP
611 .\"O There are
612 .\"O a number of options, at least one of which (either
613 .\"O .B FTS_LOGICAL
614 .\"O or
615 .\"O .BR FTS_PHYSICAL )
616 .\"O must be specified.
617 .\"O The options are selected by ORing
618 .\"O the following values:
619 多くのオプションがあり、少なくとも 1 つ
620 .RB ( FTS_LOGICAL
621 または
622 .BR FTS_PHYSICAL )
623 が指定されなければならない。
624 オプションは以下の値の論理和をとって選択する。
625 .\" .Bl -tag -width "FTS_PHYSICAL"
626 .TP
627 .B FTS_COMFOLLOW
628 .\"O This option causes any symbolic link specified as a root path to be
629 .\"O followed immediately whether or not
630 .\"O .B FTS_LOGICAL
631 .\"O is also specified.
632 このオプションは、
633 .B FTS_LOGICAL
634 の指定にかかわらず、
635 ルートパスに指定されたシンボリックリンクをすぐにたどらせる。
636 .TP
637 .B FTS_LOGICAL
638 .\"O This option causes the
639 .\"O fts routines to return
640 .\"O .I FTSENT
641 .\"O structures for the targets of symbolic links
642 .\"O instead of the symbolic links themselves.
643 .\"O If this option is set, the only symbolic links for which
644 .\"O .I FTSENT
645 .\"O structures
646 .\"O are returned to the application are those referencing non-existent files.
647 .\"O Either
648 .\"O .B FTS_LOGICAL
649 .\"O or
650 .\"O .B FTS_PHYSICAL
651 .\"O .I must
652 .\"O be provided to the
653 .\"O .BR fts_open ()
654 .\"O function.
655 このオプションは、
656 fts ルーチンにシンボリックリンクそのものではなく、
657 シンボリックリンクが指しているファイルの
658 .I FTSENT
659 構造体を返させる。
660 このオプションが設定された場合、
661 .I FTSENT
662 構造体がアプリケーションに返されるような
663 シンボリックリンクのみが、存在しないファイルを参照している。
664 .B FTS_LOGICAL
665 または
666 .B FTS_PHYSICAL
667 のどちらかを、
668 .BR fts_open ()
669 関数に与えなければ「ならない」。
670 .TP
671 .B FTS_NOCHDIR
672 .\"O As a performance optimization, the
673 .\"O fts functions change directories as they walk the file hierarchy.
674 .\"O This has the side-effect that an application cannot rely on being
675 .\"O in any particular directory during the traversal.
676 .\"O The
677 .\"O .B FTS_NOCHDIR
678 .\"O option turns off this optimization, and the
679 .\"O fts functions will not change the current directory.
680 .\"O Note that applications should not themselves change their current directory
681 .\"O and try to access files unless
682 .\"O .B FTS_NOCHDIR
683 .\"O is specified and absolute
684 .\"O pathnames were provided as arguments to
685 .\"O .BR fts_open ().
686 パフォーマンスの最適化のため、
687 fts 関数群はファイル階層をたどるときディレクトリを変える。
688 これには、階層をたどっている間は
689 アプリケーションがある特定のディレクトリにいるということに
690 依存できない、という副作用がある。
691 .B FTS_NOCHDIR
692 オプションで最適化を無効にすると、
693 fts 関数群は現在のディレクトリを変更しない。
694 .B FTS_NOCHDIR
695 が指定され、かつ
696 .BR fts_open ()
697 の引き数として絶対パス名が与えられたとき以外、アプリケーションは、
698 自らカレントディレクトリを変更したり、
699 ファイルにアクセスしたりすべきではない、という点に注意すること。
700 .TP
701 .B FTS_NOSTAT
702 .\"O By default, returned
703 .\"O .I FTSENT
704 .\"O structures reference file characteristic information (the
705 .\"O .I statp
706 .\"O field) for each file visited.
707 .\"O This option relaxes that requirement as a performance optimization,
708 .\"O allowing the
709 .\"O fts functions to set the
710 .\"O .I fts_info
711 .\"O field to
712 .\"O .B FTS_NSOK
713 .\"O and leave the contents of the
714 .\"O .I statp
715 .\"O field undefined.
716 デフォルトでは、返された
717 .I FTSENT
718 構造体は、たどられた各ファイルについてのファイル特徴情報
719 .I ( statp
720 フィールド) を参照する。
721 このオプションは、
722 fts 関数群が
723 .I fts_info
724 フィールドを
725 .B FTS_NSOK
726 に設定し
727 .I statp
728 の内容を定義されないままにすることを許すことにより、
729 パフォーマンスの最適化に必要なものを緩和する。
730 .TP
731 .B FTS_PHYSICAL
732 .\"O This option causes the
733 .\"O fts routines to return
734 .\"O .I FTSENT
735 .\"O structures for symbolic links themselves instead
736 .\"O of the target files they point to.
737 .\"O If this option is set,
738 .\"O .I FTSENT
739 .\"O structures for all symbolic links in the
740 .\"O hierarchy are returned to the application.
741 .\"O Either
742 .\"O .B FTS_LOGICAL
743 .\"O or
744 .\"O .B FTS_PHYSICAL
745 .\"O .I must
746 .\"O be provided to the
747 .\"O .BR fts_open ()
748 .\"O function.
749 このオプションは、
750 fts ルーチンにシンボリックリンクが指しているファイルではなく、
751 シンボリックリンク自身の
752 .I FTSENT
753 構造体を返させる。
754 このオプションが設定されると、階層中のすべてのシンボリックリンクの
755 .I FTSENT
756 構造体がアプリケーションに返される。
757 .B FTS_LOGICAL
758 または
759 .B FTS_PHYSICAL
760 のどちらかを
761 .BR fts_open ()
762 関数に与えなければ「ならない」。
763 .TP
764 .B FTS_SEEDOT
765 .\"O By default, unless they are specified as path arguments to
766 .\"O .BR fts_open (),
767 .\"O any files named
768 .\"O "."
769 .\"O or
770 .\"O ".."
771 .\"O encountered in the file hierarchy are ignored.
772 .\"O This option causes the
773 .\"O fts routines to return
774 .\"O .I FTSENT
775 .\"O structures for them.
776 デフォルトでは、
777 .BR fts_open ()
778 のパス引き数として指定されない限り、ファイル階層中にある
779 "." または ".." という名前のファイルは無視される。
780 このオプションは、
781 fts ルーチンにこれらのファイルの
782 .I FTSENT
783 構造体を返させる。
784 .TP
785 .B FTS_XDEV
786 .\"O This option prevents
787 .\"O fts from descending into directories that have a different device number
788 .\"O than the file from which the descent began.
789 このオプションは、
790 fts が下り始めのファイルとは異なるデバイス番号を持っている
791 ディレクトリに下りるのを阻止する。
792 .\" .El
793 .PP
794 .\"O The argument
795 .\"O .BR compar ()
796 .\"O specifies a user-defined function which may be used to order the traversal
797 .\"O of the hierarchy.
798 .\"O It
799 .\"O takes two pointers to pointers to
800 .\"O .I FTSENT
801 .\"O structures as arguments and
802 .\"O should return a negative value, zero, or a positive value to indicate
803 .\"O if the file referenced by its first argument comes before, in any order
804 .\"O with respect to, or after, the file referenced by its second argument.
805 .\"O The
806 .\"O .IR fts_accpath ,
807 .\"O .I fts_path
808 .\"O and
809 .\"O .I fts_pathlen
810 .\"O fields of the
811 .\"O .I FTSENT
812 .\"O structures may
813 .\"O .I never
814 .\"O be used in this comparison.
815 .\"O If the
816 .\"O .I fts_info
817 .\"O field is set to
818 .\"O .B FTS_NS
819 .\"O or
820 .\"O .BR FTS_NSOK ,
821 .\"O the
822 .\"O .I fts_statp
823 .\"O field may not either.
824 .\"O If the
825 .\"O .BR compar ()
826 .\"O argument is
827 .\"O .BR NULL ,
828 .\"O the directory traversal order is in the order listed in
829 .\"O .I path_argv
830 .\"O for the root paths, and in the order listed in the directory for
831 .\"O everything else.
832 引き数
833 .BR compar ()
834 は、階層をたどる順番を決めるのに使われるユーザー定義関数を指定する。
835 この関数は、引き数として
836 .I FTSENT
837 構造体のポインタのポインタを 2 つとり、
838 1 番目の引き数で参照されているファイルが
839 2 番目の引き数で参照されているファイルより
840 前にある場合は負の値・同じ場合はゼロ・後にある場合は正の値を
841 返さなければならない。
842 .I FTSENT
843 構造体の
844 .IR fts_accpath ,
845 .IR fts_path ,
846 .I fts_pathlen
847 フィールドは、この比較に「絶対」使ってはいけない。
848 .I fts_info
849 フィールドが
850 .B FTS_NS
851 または
852 .B FTS_NSOK
853 に設定される場合、
854 .I fts_statp
855 フィールドはこれらのどちらでもない。
856 .BR compar ()
857 引き数が
858 .B NULL
859 の場合、ディレクトリをたどる順番は、ルートパスについては
860 .I path_argv
861 のなかでリストされた順番で、
862 その他のファイルについてはディレクトリ内でリストされた順番となる。
863 .SS fts_read()
864 .\"O The
865 .\"O .BR fts_read ()
866 .\"O function returns a pointer to an
867 .\"O .I FTSENT
868 .\"O structure describing a file in
869 .\"O the hierarchy.
870 .\"O Directories (that are readable and do not cause cycles) are visited at
871 .\"O least twice, once in preorder and once in postorder.
872 .\"O All other files are visited at least once.
873 .\"O (Hard links between directories that do not cause cycles or symbolic
874 .\"O links to symbolic links may cause files to be visited more than once,
875 .\"O or directories more than twice.)
876 .BR fts_read ()
877 関数は、階層中のファイルを記述する
878 .I FTSENT
879 構造体へのポインタを返す。
880 (読み込み可能で、循環していない) ディレクトリは、
881 1 回は preorder で、もう 1 回は postorder で、少なくとも 2 回たどられる。
882 他のファイルは、少なくとも 1 回たどられる。
883 (ディレクトリ間のハードリンクによって
884 循環やシンボリックリンクへのシンボリックリンクが起こらない場合、
885 ファイルは 2 回以上、ディレクトリは 3 回以上たどられる。)
886 .PP
887 .\"O If all the members of the hierarchy have been returned,
888 .\"O .BR fts_read ()
889 .\"O returns
890 .\"O .B NULL
891 .\"O and sets the external variable
892 .\"O .I errno
893 .\"O to 0.
894 .\"O If an error unrelated to a file in the hierarchy occurs,
895 .\"O .BR fts_read ()
896 .\"O returns
897 .\"O .B NULL
898 .\"O and sets
899 .\"O .I errno
900 .\"O appropriately.
901 .\"O If an error related to a returned file occurs, a pointer to an
902 .\"O .I FTSENT
903 .\"O structure is returned, and
904 .\"O .I errno
905 .\"O may or may not have been set (see
906 .\"O .IR fts_info ).
907 階層中のすべてのメンバーが返された場合、
908 .BR fts_read ()
909
910 .B NULL
911 を返し、外部変数
912 .I errno
913 を 0 にする。
914 階層中のファイルに関係しないエラーが起こった場合、
915 .BR fts_read ()
916
917 .B NULL
918 を返し、
919 .I errno
920 をエラーに対応した値にする。
921 階層中のファイルに関係したエラーが起こった場合、
922 .I FTSENT
923 構造体へのポインタが返され、
924 .I errno
925 は設定される場合と設定されない場合がある
926 .RI ( fts_info
927 を参照すること)。
928 .PP
929 .\"O The
930 .\"O .I FTSENT
931 .\"O structures returned by
932 .\"O .BR fts_read ()
933 .\"O may be overwritten after a call to
934 .\"O .BR fts_close ()
935 .\"O on the same file hierarchy stream, or, after a call to
936 .\"O .BR fts_read ()
937 .\"O on the same file hierarchy stream unless they represent a file of type
938 .\"O directory, in which case they will not be overwritten until after a call to
939 .\"O .BR fts_read ()
940 .\"O after the
941 .\"O .I FTSENT
942 .\"O structure has been returned by the function
943 .\"O .BR fts_read ()
944 .\"O in postorder.
945 .BR fts_read ()
946 によって返される
947 .I FTSENT
948 構造体は、同じファイル階層ストリームへの
949 .BR fts_close ()
950 の呼出しの後に上書きされる。
951 また、同じファイル階層ストリームへの
952 .BR fts_read ()
953 の呼出しの後でも、構造体がディレクトリを表現していない限り上書きされる。
954 この場合、
955 .BR fts_read ()
956 関数によって postorder で
957 .I FTSENT
958 構造体が返された後、
959 .BR fts_read ()
960 の呼出しがあるまで、
961 これらの構造体は上書きされない。
962 .SS fts_children()
963 .\"O The
964 .\"O .BR fts_children ()
965 .\"O function returns a pointer to an
966 .\"O .I FTSENT
967 .\"O structure describing the first entry in a NULL-terminated linked list of
968 .\"O the files in the directory represented by the
969 .\"O .I FTSENT
970 .\"O structure most recently returned by
971 .\"O .BR fts_read ().
972 .\"O The list is linked through the
973 .\"O .I fts_link
974 .\"O field of the
975 .\"O .I FTSENT
976 .\"O structure, and is ordered by the user-specified comparison function, if any.
977 .\"O Repeated calls to
978 .\"O .BR fts_children ()
979 .\"O will recreate this linked list.
980 .BR fts_children ()
981 関数は、
982 .I FTSENT
983 構造体へのポインタを返す。
984 この構造体は、(
985 .BR fts_read ()
986 で最も新しく返された
987 .I FTSENT
988 構造体で表現されるディレクトリにあるファイルの)
989 NUL 終端されたリンクリストの最初のエントリを記述する。
990 このリストは、
991 .I FTSENT
992 構造体の
993 .I fts_link
994 フィールドを使ってリンクされ、
995 ユーザー指定の比較関数がある場合は、それで順序づけられる。
996 .BR fts_children ()
997 の呼出しを繰り返すことで、
998 このリンクリストは再生成される。
999 .PP
1000 .\"O As a special case, if
1001 .\"O .BR fts_read ()
1002 .\"O has not yet been called for a hierarchy,
1003 .\"O .BR fts_children ()
1004 .\"O will return a pointer to the files in the logical directory specified to
1005 .\"O .BR fts_open (),
1006 .\"O that is, the arguments specified to
1007 .\"O .BR fts_open ().
1008 .\"O Otherwise, if the
1009 .\"O .I FTSENT
1010 .\"O structure most recently returned by
1011 .\"O .BR fts_read ()
1012 .\"O is not a directory being visited in preorder,
1013 .\"O or the directory does not contain any files,
1014 .\"O .BR fts_children ()
1015 .\"O returns
1016 .\"O .B NULL
1017 .\"O and sets
1018 .\"O .I errno
1019 .\"O to zero.
1020 .\"O If an error occurs,
1021 .\"O .BR fts_children ()
1022 .\"O returns
1023 .\"O .B NULL
1024 .\"O and sets
1025 .\"O .I errno
1026 .\"O appropriately.
1027 特別な場合として、
1028 .BR fts_read ()
1029 がファイル階層について呼ばれていない場合、
1030 .BR fts_children ()
1031
1032 .BR fts_open ()
1033 に指定された論理ディレクトリ (つまり、
1034 .BR fts_open ()
1035 に指定された引き数) の中にあるファイルへのポインタを返す。
1036 それ以外の場合で、
1037 .BR fts_read ()
1038 によって最も新しく返された
1039 .I FTSENT
1040 構造体が preorder でたどられたディレクトリでない場合や
1041 何も含んでいないディレクトリの場合は、
1042 .BR fts_children ()
1043
1044 .B NULL
1045 を返し、
1046 .I errno
1047 を 0 にする。
1048 エラーが起こった場合、
1049 .BR fts_children ()
1050
1051 .B NULL
1052 を返し、
1053 .I errno
1054 をエラーに対応した値にする。
1055 .PP
1056 .\"O The
1057 .\"O .I FTSENT
1058 .\"O structures returned by
1059 .\"O .BR fts_children ()
1060 .\"O may be overwritten after a call to
1061 .\"O .BR fts_children (),
1062 .\"O .BR fts_close ()
1063 .\"O or
1064 .\"O .BR fts_read ()
1065 .\"O on the same file hierarchy stream.
1066 .BR fts_children ()
1067 によって返される
1068 .I FTSENT
1069 構造体は、同じファイル階層ストリームへの
1070 .BR fts_children (),
1071 .BR fts_close (),
1072 .BR fts_read ()
1073 の呼出しの後に上書きされる場合がある。
1074 .PP
1075 .\"O .I Option
1076 .\"O may be set to the following value:
1077 .I option
1078 は、次の値に設定できる。
1079 .\" .Bl -tag -width FTS_NAMEONLY
1080 .TP
1081 .B FTS_NAMEONLY
1082 .\"O Only the names of the files are needed.
1083 .\"O The contents of all the fields in the returned linked list of structures
1084 .\"O are undefined with the exception of the
1085 .\"O .I fts_name
1086 .\"O and
1087 .\"O .I fts_namelen
1088 .\"O fields.
1089 ファイル名のみが必要とされている。
1090 返された構造体のリンクリストの
1091 .IR fts_name ,
1092 .I fts_namelen
1093 フィールド以外の
1094 すべてのフィールドの内容は定義されない。
1095 .\" .El
1096 .SS fts_set()
1097 .\"O The function
1098 .\"O .BR fts_set ()
1099 .\"O allows the user application to determine further processing for the
1100 .\"O file
1101 .\"O .I f
1102 .\"O of the stream
1103 .\"O .IR ftsp .
1104 .\"O The
1105 .\"O .BR fts_set ()
1106 .\"O function
1107 .\"O returns 0 on success, and \-1 if an error occurs.
1108 .\"O .I Option
1109 .\"O must be set to one of the following values:
1110 関数
1111 .BR fts_set ()
1112 は、ユーザーアプリケーションが
1113 ストリーム
1114 .I ftsp
1115 のファイル
1116 .I f
1117 について更なる処理を決定すること許す。
1118 .BR fts_set ()
1119 関数は、成功した場合は 0 を、エラーが起こった場合は \-1 を返す。
1120 .I option
1121 は、次の値のいずれか 1 つに設定されなければならない。
1122 .\" .Bl -tag -width FTS_PHYSICAL
1123 .TP
1124 .B FTS_AGAIN
1125 .\"O Re-visit the file; any file type may be revisited.
1126 .\"O The next call to
1127 .\"O .BR fts_read ()
1128 .\"O will return the referenced file.
1129 .\"O The
1130 .\"O .I fts_stat
1131 .\"O and
1132 .\"O .I fts_info
1133 .\"O fields of the structure will be reinitialized at that time,
1134 .\"O but no other fields will have been changed.
1135 .\"O This option is meaningful only for the most recently returned
1136 .\"O file from
1137 .\"O .BR fts_read ().
1138 .\"O Normal use is for postorder directory visits, where it causes the
1139 .\"O directory to be revisited (in both preorder and postorder) as well as all
1140 .\"O of its descendants.
1141 ファイルを再びたどる。すべてのファイルタイプが再びたどられる。
1142 次の
1143 .BR fts_read ()
1144 の呼出しにより、参照されているファイルが返される。
1145 構造体の
1146 .IR fts_stat ,
1147 .I fts_info
1148 フィールドはこの時に初期化されるが、他のフィールドは変更されない。
1149 このオプションは、
1150 .BR fts_read ()
1151 によって最も新しく返されたファイルについてのみ意味を持つ。
1152 通常は、postorder でディレクトリをたどる場合に使用し、
1153 その下の階層と同様に、
1154 ディレクトリを (preorder と postorder の両方で) 再びたどらせる。
1155 .TP
1156 .B FTS_FOLLOW
1157 .\"O The referenced file must be a symbolic link.
1158 .\"O If the referenced file is the one most recently returned by
1159 .\"O .BR fts_read (),
1160 .\"O the next call to
1161
1162 .\"O .BR fts_read ()
1163 .\"O returns the file with the
1164 .\"O .I fts_info
1165 .\"O and
1166 .\"O .I fts_statp
1167 .\"O fields reinitialized to reflect the target of the symbolic link instead
1168 .\"O of the symbolic link itself.
1169 .\"O If the file is one of those most recently returned by
1170 .\"O .BR fts_children (),
1171 .\"O the
1172 .\"O .I fts_info
1173 .\"O and
1174 .\"O .I fts_statp
1175 .\"O fields of the structure, when returned by
1176 .\"O .BR fts_read (),
1177 .\"O will reflect the target of the symbolic link instead of the symbolic link
1178 .\"O itself.
1179 .\"O In either case, if the target of the symbolic link does not exist the
1180 .\"O fields of the returned structure will be unchanged and the
1181 .\"O .I fts_info
1182 .\"O field will be set to
1183 .\"O .BR FTS_SLNONE .
1184 .\"O .PP
1185 .\"O If the target of the link is a directory, the preorder return, followed
1186 .\"O by the return of all of its descendants, followed by a postorder return,
1187 .\"O is done.
1188 参照されてるファイルは、シンボリックリンクでなければならない。
1189 参照されているファイルが
1190 .BR fts_read ()
1191 によって最も新しく返されたものである場合、次の
1192 .BR fts_read ()
1193 の呼出しでは、シンボリックリンクそのものではなく、
1194 シンボリックリンクが指している先を反映するように
1195 .IR fts_info ,
1196 .I fts_statp
1197 を再び初期化したファイルが返される。
1198 ファイルが
1199 .BR fts_children ()
1200 によって最も新しく返されたものの 1 つである場合、
1201 .BR fts_read ()
1202 によって返されたとき、構造体の
1203 .IR fts_info ,
1204 .I fts_statp
1205 フィールドは、シンボリックリンクそのものではなく、
1206 シンボリックリンクが指している先を反映する。
1207 どちらの場合でも、シンボリックリンクが指している先がないときは、
1208 返された構造体のフィールドは変更されず、
1209 .I fts_info
1210 フィールドが
1211 .B FTS_SLNONE
1212 に設定される。
1213 .PP
1214 .\"O If the target of the link is a directory, the preorder return, followed
1215 .\"O by the return of all of its descendants, followed by a postorder return,
1216 .\"O is done.
1217 リンク先がディレクトリの場合、
1218 ファイルが preorder で返された後、下の階層のすべてファイルが返され、
1219 その後で postorder で返される。
1220 .TP
1221 .B FTS_SKIP
1222 .\"O No descendants of this file are visited.
1223 .\"O The file may be one of those most recently returned by either
1224 .\"O .BR fts_children ()
1225 .\"O or
1226 .\"O .BR fts_read ().
1227 このファイルの下の階層はたどられない。
1228 このファイルは、
1229 .BR fts_children ()
1230 または
1231 .BR fts_read ()
1232 のどちらかによって最も新しく返されたものの 1 つである。
1233 .\" .El
1234 .SS fts_close()
1235 .\"O The
1236 .\"O .BR fts_close ()
1237 .\"O function closes a file hierarchy stream
1238 .\"O .I ftsp
1239 .\"O and restores the current directory to the directory from which
1240 .\"O .BR fts_open ()
1241 .\"O was called to open
1242 .\"O .IR ftsp .
1243 .\"O The
1244 .\"O .BR fts_close ()
1245 .\"O function
1246 .\"O returns 0 on success, and \-1 if an error occurs.
1247 .BR fts_close ()
1248 関数は、ファイル階層ストリーム
1249 .I ftsp
1250 を閉じる。そして、現在のディレクトリを
1251 .I ftsp
1252 を開くために
1253 .BR fts_open ()
1254 が呼ばれたディレクトリに復元する。
1255 .BR fts_close ()
1256 関数は、成功した場合は 0 を、エラーが起こった場合は \-1 を返す。
1257 .\"O .SS ERRORS
1258 .SS エラー
1259 .\"O The function
1260 .\"O .BR fts_open ()
1261 .\"O may fail and set
1262 .\"O .I errno
1263 .\"O for any of the errors specified for the library functions
1264 .\"O .BR open (2)
1265 .\"O and
1266 .\"O .BR malloc (3).
1267 関数
1268 .BR fts_open ()
1269 が失敗した場合、
1270 .I errno
1271 は、ライブラリ関数
1272 .BR open (2)
1273
1274 .BR malloc (3)
1275 に対して指定されるエラーに設定される。
1276 .PP
1277 .\"O The function
1278 .\"O .BR fts_close ()
1279 .\"O may fail and set
1280 .\"O .I errno
1281 .\"O for any of the errors specified for the library functions
1282 .\"O .BR chdir (2)
1283 .\"O and
1284 .\"O .BR close (2).
1285 関数
1286 .BR fts_close ()
1287 が失敗した場合、
1288 .I errno
1289 は、ライブラリ関数
1290 .BR chdir (2)
1291
1292 .BR close (2)
1293 に対して指定されるエラーに設定される。
1294 .PP
1295 .\"O The functions
1296 .\"O .BR fts_read ()
1297 .\"O and
1298 .\"O .BR fts_children ()
1299 .\"O may fail and set
1300 .\"O .I errno
1301 .\"O for any of the errors specified for the library functions
1302 .\"O .BR chdir (2),
1303 .\"O .BR malloc (3),
1304 .\"O .BR opendir (3),
1305 .\"O .BR readdir (3)
1306 .\"O and
1307 .\"O .BR stat (2).
1308 関数
1309 .BR fts_read ()
1310
1311 .BR fts_children ()
1312 が失敗した場合、
1313 .I errno
1314 は、ライブラリ関数
1315 .BR chdir (2),
1316 .BR malloc (3),
1317 .BR opendir (3),
1318 .BR readdir (3),
1319 .BR stat (2)
1320 に対して指定されるエラーに設定される。
1321 .PP
1322 .\"O In addition,
1323 .\"O .BR fts_children (),
1324 .\"O .BR fts_open ()
1325 .\"O and
1326 .\"O .BR fts_set ()
1327 .\"O may fail and set
1328 .\"O .I errno
1329 .\"O as follows:
1330 更に、
1331 .BR fts_children (),
1332 .BR fts_open (),
1333 .BR fts_set ()
1334 が失敗した場合、
1335 .I errno
1336 が次の値にされる。
1337 .TP
1338 .B EINVAL
1339 .\"O The options were invalid.
1340 オプションが無効であった。
1341 .\"O .SH VERSIONS
1342 .SH バージョン
1343 .\"O These functions are available in Linux since glibc2.
1344 これらの関数は、Linux では glibc2 から使用可能である。
1345 .\"O SH "CONFORMING TO"
1346 .SH 準拠
1347 4.4BSD.
1348 .\" The following statement is years old, and seems no closer to
1349 .\" being true -- mtk
1350 .\"O .\" The
1351 .\"O .\" .I fts
1352 .\"O .\" utility is expected to be included in a future
1353 .\"O .\" POSIX.1
1354 .\"O .\" revision.
1355 .\" .I fts
1356 .\" ユーティリティは、将来の
1357 .\" POSIX.1
1358 .\" リビジョンに含まれると期待されている。
1359 .\"O .SH SEE ALSO
1360 .SH 関連項目
1361 .BR find (1),
1362 .BR chdir (2),
1363 .BR stat (2),
1364 .BR ftw (3),
1365 .BR qsort (3)