OSDN Git Service

(split) LDP: draft snapshot generated from latest ja.po files.
[linuxjm/LDP_man-pages.git] / draft / man3 / ftw.3
index a15f211..b462246 100644 (file)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1993 Michael Haardt (u31b3hs@pool.informatik.rwth-aachen.de)
+.\" Copyright (c) 1993 Michael Haardt (michael@moria.de)
 .\" and copyright (c) 1999 Andries Brouwer (aeb@cwi.nl)
 .\" and copyright (c) 2006 Justin Pryzby <justinpryzby@users.sf.net>
 .\" and copyright (c) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
@@ -20,7 +20,7 @@
 .\"
 .\" You should have received a copy of the GNU General Public
 .\" License along with this manual; if not, write to the Free
-.\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
+.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
 .\" USA.
 .\"
 .\" Modified Sun Jul 25 11:02:22 1993 by Rik Faith (faith@cs.unc.edu)
 .\"    reorganized and rewrote much of the page
 .\" 2006-05-24, Michael Kerrisk <mtk.manpages@gmail.com>
 .\"    Added an example program.
+.\"*******************************************************************
 .\"
-.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
-.\" Translated 1998-04-28, NAKANO Takeo <nakano@apm.seikei.ac.jp>
-.\" Updated & Modified 1999-09-14, NAKANO Takeo <nakano@apm.seikei.ac.jp>
-.\" Updated & Modified 2005-11-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
-.\" Updated 2006-07-26, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.36
+.\" This file was generated with po4a. Translate the source file.
 .\"
-.\" WORD:       file descriptor         ファイルディスクリプター
-.\"
-.TH FTW 3 2010-09-20 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
+.\"*******************************************************************
+.TH FTW 3 2010\-09\-20 Linux "Linux Programmer's Manual"
 .SH 名前
-.\"O ftw, nftw \- file tree walk
 ftw, nftw \- ファイルツリーを歩きまわる
-.\"O .SH SYNOPSIS
 .SH 書式
 .nf
-.B #include <ftw.h>
+\fB#include <ftw.h>\fP
 .sp
-.BI "int ftw(const char *" dirpath ,
-.BI "        int (*" fn ") (const char *" fpath ", const struct stat *" sb ,
-.BI "                   int " typeflag ),
-.BI "        int " nopenfd );
+\fBint ftw(const char *\fP\fIdirpath\fP\fB,\fP
+\fB        int (*\fP\fIfn\fP\fB) (const char *\fP\fIfpath\fP\fB, const struct stat *\fP\fIsb\fP\fB,\fP
+\fB                   int \fP\fItypeflag\fP\fB),\fP
+\fB        int \fP\fInopenfd\fP\fB);\fP
 .sp
-.\"O .BR "#define _XOPEN_SOURCE 500" "   /* See feature_test_macros(7) */"
-.BR "#define _XOPEN_SOURCE 500" "   /* feature_test_macros(7) 参照 */"
-.B #define _XOPEN_SOURCE 500
-.B #include <ftw.h>
+\fB#define _XOPEN_SOURCE 500\fP   /* feature_test_macros(7) 参照 */
+\fB#define _XOPEN_SOURCE 500\fP
+\fB#include <ftw.h>\fP
 .sp
-.BI "int nftw(const char *" dirpath ,
-.BI "        int (*" fn ") (const char *" fpath ", const struct stat *" sb ,
-.BI "                   int " typeflag ", struct FTW *" ftwbuf ),
-.BI "        int " nopenfd ", int " flags );
+\fBint nftw(const char *\fP\fIdirpath\fP\fB,\fP
+\fB        int (*\fP\fIfn\fP\fB) (const char *\fP\fIfpath\fP\fB, const struct stat *\fP\fIsb\fP\fB,\fP
+\fB                   int \fP\fItypeflag\fP\fB, struct FTW *\fP\fIftwbuf\fP\fB),\fP
+\fB        int \fP\fInopenfd\fP\fB, int \fP\fIflags\fP\fB);\fP
 .fi
-.\"O .SH DESCRIPTION
 .SH 説明
-.\"O .BR ftw ()
-.\"O walks through the directory tree that is
-.\"O located under the directory \fIdirpath\fP,
-.\"O and calls \fIfn\fP() once for each entry in the tree.
-.\"O By default, directories are handled before the files and
-.\"O subdirectories they contain (preorder traversal).
-.BR ftw ()
-は、
-.I dirpath
-で指定されたディレクトリ以下のディレクトリツリー全体を歩きまわり、
-ツリー中でエントリが見付かるごとに、
-.IR fn ()
-を呼び出す。
-デフォルトでは、ディレクトリそのものが、そのディレクトリにあるファイルや
-サブディレクトリよりも先に処理される (行きがけ順探索; preorder traversal)。
+\fBftw\fP()  は、 \fIdirpath\fP で指定されたディレクトリ以下のディレクトリツリー全体を歩きまわり、 ツリー中でエントリが見付かるごとに、
+\fIfn\fP()  を呼び出す。 デフォルトでは、ディレクトリそのものが、そのディレクトリにあるファイルや サブディレクトリよりも先に処理される
+(行きがけ順探索; preorder traversal)。
 
-.\"O To avoid using up all of the calling process's file descriptors,
-.\"O \fInopenfd\fP specifies the maximum number of directories that
-.\"O .BR ftw ()
-.\"O will hold open simultaneously.
-.\"O When
-.\"O the search depth exceeds this,
-.\"O .BR ftw ()
-.\"O will become slower because
-.\"O directories have to be closed and reopened.
-.\"O .BR ftw ()
-.\"O uses at most
-.\"O one file descriptor for each level in the directory tree.
-呼び出し元プロセスが利用可能なファイルディスクリプタを使い切って
-しまわないようにするため、
-.BR ftw ()
-が同時にオープンするディレクトリの最大数を
-.I nopenfd
-で指定することができる。
-探索の深さがこの値を越えると、
-一つのディレクトリを閉じてから他のディレクトリをオープンし直すこと
-になるので、
-.BR ftw ()
-の動作は遅くなる。
-.BR ftw ()
-は、ディレクトリツリーの階層 1 レベルにつき、
-最大でも一つのファイルディスクリプタしか使用しない。
+呼び出し元プロセスが利用可能なファイルディスクリプタを使い切って しまわないようにするため、 \fBftw\fP()
+が同時にオープンするディレクトリの最大数を \fInopenfd\fP で指定することができる。 探索の深さがこの値を越えると、
+一つのディレクトリを閉じてから他のディレクトリをオープンし直すこと になるので、 \fBftw\fP()  の動作は遅くなる。 \fBftw\fP()
+は、ディレクトリツリーの階層 1 レベルにつき、 最大でも一つのファイルディスクリプタしか使用しない。
 
-.\"O For each entry found in the tree,
-.\"O .BR ftw ()
-.\"O calls
-.\"O \fIfn\fP() with three arguments:
-.\"O .IR fpath ,
-.\"O .IR sb ,
-.\"O and
-.\"O .IR typeflag .
-ディレクトリツリーで見つかったエントリ毎に、
-.BR ftw ()
-は
-.IR fpath ,
-.IR sb ,
-.I typeflag
-の 3つを引き数として
-.IR fn ()
-を呼び出す。
-.\"O .I fpath
-.\"O is the pathname of the entry,
-.\"O and is expressed either as a pathname relative to the calling process's
-.\"O current working directory at the time of the call to
-.\"O .BR ftw (),
-.\"O if
-.\"O .IR dirpath
-.\"O was expressed as a relative pathname,
-.\"O or as an absolute pathname, if
-.\"O .I dirpath
-.\"O was expressed as an absolute pathname.
-.I fpath
-はエントリのパス名である。
-.I dirpath
-が相対パス名で指定された場合には、
-.I fpath
-は
-.BR ftw ()
-が呼び出された時点の呼び出し元プロセスのカレントワーキングディレクトリ
-からの相対パス名となる。
-.I dirpath
-が絶対パス名で指定された場合には、
-.I fpath
-は絶対パス名となる。
-.\"O .I sb
-.\"O is a pointer to the
-.\"O .I stat
-.\"O structure returned by a call to
-.\"O .BR stat (2)
-.\"O for
-.\"O .IR fpath .
-.I sb
-は
-.I fpath
-に対する
-.BR stat (2)
-の呼び出しで返される
-.I stat
-構造体へのポインタである。
-.\"O .I typeflag
-.\"O is an integer that has one of the following values:
-.I typeflag
-は整数で、以下の値のいずれか一つである:
-.TP
-.B FTW_F
-.\"O .I fpath
-.\"O is a regular file.
-.I fpath
-が通常のファイルである
-.TP
-.B FTW_D
-.\"O .I fpath
-.\"O is a directory.
-.I fpath
-がディレクトリである
-.TP
-.B FTW_DNR
-.\"O .I fpath
-.\"O is a directory which can't be read.
-.I fpath
-が読み込みできないディレクトリである
-.TP
-.B FTW_NS
-.\"O The
-.\"O .BR stat (2)
-.\"O call failed on
-.\"O .IR fpath ,
-.\"O which is not a symbolic link.
-シンボリックリンクではない
-.I fpath
-に対する
-.BR stat (2)
-呼び出しが失敗した。
+ディレクトリツリーで見つかったエントリ毎に、 \fBftw\fP()  は \fIfpath\fP, \fIsb\fP, \fItypeflag\fP の 3つを引き数として
+\fIfn\fP()  を呼び出す。 \fIfpath\fP はエントリのパス名である。 \fIdirpath\fP が相対パス名で指定された場合には、 \fIfpath\fP
+は \fBftw\fP()  が呼び出された時点の呼び出し元プロセスのカレントワーキングディレクトリ からの相対パス名となる。 \fIdirpath\fP
+が絶対パス名で指定された場合には、 \fIfpath\fP は絶対パス名となる。 \fIsb\fP は \fIfpath\fP に対する \fBstat\fP(2)
+の呼び出しで返される \fIstat\fP 構造体へのポインタである。 \fItypeflag\fP は整数で、以下の値のいずれか一つである:
+.TP 
+\fBFTW_F\fP
+\fIfpath\fP が通常のファイルである
+.TP 
+\fBFTW_D\fP
+\fIfpath\fP がディレクトリである
+.TP 
+\fBFTW_DNR\fP
+\fIfpath\fP が読み込みできないディレクトリである
+.TP 
+\fBFTW_NS\fP
+シンボリックリンクではない \fIfpath\fP に対する \fBstat\fP(2)  呼び出しが失敗した。
 .sp
-.\"O If
-.\"O .I fpath
-.\"O is a symbolic link and
-.\"O .BR stat (2)
-.\"O failed, POSIX.1-2001 states
-.\"O that it is undefined whether \fBFTW_NS\fP or \fBFTW_SL\fP (see below)
-.\"O is passed in
-.\"O .IR typeflag .
-.I fpath
-がシンボリックリンクで、かつ
-.BR stat (2)
-が失敗した場合、
-.B FTW_NS
-と
-.B FTW_SL
-(後述) のどちらが
-.I typeflag
-に渡されるかは未定義であると、POSIX.1-2001 には書かれている。
+\fIfpath\fP がシンボリックリンクで、かつ \fBstat\fP(2)  が失敗した場合、 \fBFTW_NS\fP と \fBFTW_SL\fP (後述)
+のどちらが \fItypeflag\fP に渡されるかは未定義であると、POSIX.1\-2001 には書かれている。
 .PP
-.\"O To stop the tree walk, \fIfn\fP() returns a nonzero value; this
-.\"O value will become the return value of
-.\"O .BR ftw ().
-.\"O As long as \fIfn\fP() returns 0,
-.\"O .BR ftw ()
-.\"O will continue either until it has traversed the entire tree,
-.\"O in which case it will return zero,
-.\"O or until it encounters an error (such as a
-.\"O .BR malloc (3)
-.\"O failure), in which case it will return \-1.
-ツリーの探索を止めたい場合は、
-.IR fn ()
-が 0 以外の値を返せば良い
-(この値は
-.BR ftw ()
-自身の戻り値となる)。
-それ以外の場合は
-.BR ftw ()
-はツリー全体の探索を続け、すべてのツリーを探索し終えたところで
-0 を返す。探索中に
-.RB ( malloc (3)
-の失敗などの) エラーが起こると \-1 を返す。
+ツリーの探索を止めたい場合は、 \fIfn\fP()  が 0 以外の値を返せば良い (この値は \fBftw\fP()  自身の戻り値となる)。 それ以外の場合は
+\fBftw\fP()  はツリー全体の探索を続け、すべてのツリーを探索し終えたところで 0 を返す。探索中に (\fBmalloc\fP(3)  の失敗などの)
+エラーが起こると \-1 を返す。
 .PP
-.\"O Because
-.\"O .BR ftw ()
-.\"O uses dynamic data structures, the only safe way to
-.\"O exit out of a tree walk is to return a nonzero value from \fIfn\fP().
-.\"O To allow a signal to terminate the walk without causing a memory leak,
-.\"O have the handler set a global flag that is checked by \fIfn\fP().
-.\"O \fIDon't\fP use
-.\"O .BR longjmp (3)
-.\"O unless the program is going to terminate.
-.BR ftw ()
-は動的なデータ構造を用いるので、ツリー探索を安全に中断する唯一の方法は
-0 以外の値を
-.IR fn ()
-の返り値とすることである。割り込みを扱うには、
-例えば発生した割り込みをマークしておいて、 0 以外の値を返すようにする
-シグナルによりメモリリークを起こさずに探索を終了できるようにするには、
-シグナルハンドラで
-.IR fn ()
-がチェックするグローバルなフラグをセットするようにすればよい。
-プログラムを終了させる場合以外は、
-.BR longjmp (3)
-を使用しないこと。
+\fBftw\fP()  は動的なデータ構造を用いるので、ツリー探索を安全に中断する唯一の方法は 0 以外の値を \fIfn\fP()
+の返り値とすることである。割り込みを扱うには、 例えば発生した割り込みをマークしておいて、 0 以外の値を返すようにする
+シグナルによりメモリリークを起こさずに探索を終了できるようにするには、 シグナルハンドラで \fIfn\fP()
+がチェックするグローバルなフラグをセットするようにすればよい。 プログラムを終了させる場合以外は、 \fBlongjmp\fP(3)  を使用しないこと。
 .SS nftw()
-.\"O The function \fBnftw\fP() is the same as
-.\"O .BR ftw (),
-.\"O except that it has one additional argument, \fIflags\fP,
-.\"O and calls \fIfn\fP() with one more argument, \fIftwbuf\fP.
-関数
-.BR nftw ()
-は
-.BR ftw ()
-と同じだが、引き数
-.I flags
-が追加される点と、
-.IR fn ()
-の引き数に
-.I ftwbuf
-が追加される点が異なる。
+関数 \fBnftw\fP()  は \fBftw\fP()  と同じだが、引き数 \fIflags\fP が追加される点と、 \fIfn\fP()  の引き数に
+\fIftwbuf\fP が追加される点が異なる。
 
-.\"O This \fIflags\fP argument is formed by ORing zero or more of the
-.\"O following flags:
-この
-.I flags
-引き数は下記のフラグの 0 個以上の論理和を取ったものである:
-.TP
-.\"O .BR FTW_ACTIONRETVAL " (since glibc 2.3.3)"
-.BR FTW_ACTIONRETVAL " (glibc 2.3.3 以降)"
-.\"O If this glibc-specific flag is set, then
-.\"O .BR nftw ()
-.\"O handles the return value from
-.\"O .IR fn ()
-.\"O differently.
-.\"O .IR fn ()
-.\"O should return one of the following values:
-このフラグは glibc 固有である。
-このフラグをセットすると、
-.BR nftw ()
-の
-.IR fn ()
-の返り値の扱いが変わる。
-.IR fn ()
+この \fIflags\fP 引き数は下記のフラグの 0 個以上の論理和を取ったものである:
+.TP 
+\fBFTW_ACTIONRETVAL\fP (glibc 2.3.3 以降)
+このフラグは glibc 固有である。 このフラグをセットすると、 \fBnftw\fP()  の \fIfn\fP()  の返り値の扱いが変わる。 \fIfn\fP()
 は以下の値のいずれか一つを返す必要がある。
 .RS
-.TP
-.B FTW_CONTINUE
-.\"O Instructs
-.\"O .BR nftw ()
-.\"O to continue normally.
-.BR nftw ()
-は通常通り処理を続ける。
-.TP
-.B FTW_SKIP_SIBLINGS
-.\"O If \fIfn\fP() returns this value, then
-.\"O siblings of the current entry will be skipped,
-.\"O and processing continues in the parent.
-.IR fn ()
-がこの値を返した場合、処理中のエントリの兄弟 (同じ階層のエントリ)
-の処理はスキップされ、親ディレクトリで続きの処理が行われる。
+.TP 
+\fBFTW_CONTINUE\fP
+\fBnftw\fP()  は通常通り処理を続ける。
+.TP 
+\fBFTW_SKIP_SIBLINGS\fP
 .\" If \fBFTW_DEPTH\fP
 .\" is set, the entry's parent directory is processed next (with
 .\" \fIflag\fP set to \fBFTW_DP\fP).
-.TP
-.B FTW_SKIP_SUBTREE
-.\"O If \fIfn\fP() is called with an entry that is a directory
-.\"O (\fItypeflag\fP is \fBFTW_D\fP), this return
-.\"O value will prevent objects within that directory from being passed as
-.\"O arguments to \fIfn\fP().
-.\"O .BR nftw ()
-.\"O continues processing with the next sibling of the directory.
-.IR fn ()
-が呼び出されたエントリがディレクトリ
-.RI ( typeflag
-が
-.BR FTW_D )
-の場合に、この値を返すと
-.IR fn ()
-の引き数として渡されたディレクトリ内のエントリの処理が行われなくなる。
-.BR nftw ()
-は処理中のディレクトリの兄弟 (同じ階層のエントリ) から処理を続ける。
-.TP
-.B FTW_STOP
-.\"O Causes
-.\"O .BR nftw ()
-.\"O to return immediately with the return value
-.\"O \fBFTW_STOP\fP.
-.B nftw ()
-は、返り値
-.B FTW_STOP
-ですぐに復帰する。
+\fIfn\fP()  がこの値を返した場合、処理中のエントリの兄弟 (同じ階層のエントリ)  の処理はスキップされ、親ディレクトリで続きの処理が行われる。
+.TP 
+\fBFTW_SKIP_SUBTREE\fP
+\fIfn\fP()  が呼び出されたエントリがディレクトリ (\fItypeflag\fP が \fBFTW_D\fP)  の場合に、この値を返すと \fIfn\fP()
+の引き数として渡されたディレクトリ内のエントリの処理が行われなくなる。 \fBnftw\fP()  は処理中のディレクトリの兄弟 (同じ階層のエントリ)
+から処理を続ける。
+.TP 
+\fBFTW_STOP\fP
+\fBnftw ()\fP は、返り値 \fBFTW_STOP\fP ですぐに復帰する。
 .PP
-.\"O Other return values could be associated with new actions in the future;
-.\"O \fIfn\fP() should not return values other than those listed above.
-他の返り値は将来新しい動作に対応付けられる可能性がある。
-.IR fn ()
-は上記のリストにある値以外を返さないようにすべきである。
+他の返り値は将来新しい動作に対応付けられる可能性がある。 \fIfn\fP()  は上記のリストにある値以外を返さないようにすべきである。
 
-.\"O The feature test macro
-.\"O .B _GNU_SOURCE
-.\"O must be defined
-.\"O (before including
-.\"O .I any
-.\"O header files)
-.\"O in order to
-.\"O obtain the definition of \fBFTW_ACTIONRETVAL\fP from \fI<ftw.h>\fP.
-.I <ftw.h>
-で
-.B FTW_ACTIONRETVAL
-の定義が有効にするためには、
-(「どの」ヘッダファイルをインクルードするよりも前に)
-機能検査マクロ
-.B _GNU_SOURCE
-を定義しなければならない。
+\fI<ftw.h>\fP で \fBFTW_ACTIONRETVAL\fP の定義が有効にするためには、
+(「どの」ヘッダファイルをインクルードするよりも前に)  機能検査マクロ \fB_GNU_SOURCE\fP を定義しなければならない。
 .RE
-.TP
-.B FTW_CHDIR
-.\"O If set, do a
-.\"O .BR chdir (2)
-.\"O to each directory before handling its contents.
-.\"O This is useful if the program needs to perform some action
-.\"O in the directory in which \fIfpath\fP resides.
-セットされると、ディレクトリの内容を処理する前に
-そのディレクトリに
-.BR chdir (2)
-する。このフラグは、
-.I fpath
-が属すディレクトリで何らかの動作を実行する必要がある場合に
-便利である。
-.TP
-.B FTW_DEPTH
-.\"O If set, do a post-order traversal, that is, call \fIfn\fP() for
-.\"O the directory itself \fIafter\fP handling the contents of the directory
-.\"O and its subdirectories.
-.\"O (By default, each directory is handled \fIbefore\fP its contents.)
-セットされると、帰りがけ順探索 (post-order traversal) を行う。
-つまり、ディレクトリそのものを引き数とした
-.IR fn ()
-呼出しは、そのディレクトリに含まれるファイルとサブディレクトリに
-対する処理の「後で」行われる
-(デフォルトでは、ディレクトリ自身の処理はディレクトリ内のエントリ
-より「前に」行なわれる)。
-.TP
-.B FTW_MOUNT
-.\"O If set, stay within the same file system
-.\"O (i.e., do not cross mount points).
-セットされると、同じファイルシステムの中だけを探索対象とする
-(つまり、マウントポイントをまたぐことはない)。
-.TP
-.B FTW_PHYS
-.\"O If set, do not follow symbolic links.
-.\"O (This is what you want.)
-.\"O If not set, symbolic links are followed, but no file is reported twice.
-セットされると、シンボリックリンクを辿らない (おそらくこちらが
-通常望ましい動作だろう)。セットされていないとシンボリックリンクを
+.TP 
+\fBFTW_CHDIR\fP
+セットされると、ディレクトリの内容を処理する前に そのディレクトリに \fBchdir\fP(2)  する。このフラグは、 \fIfpath\fP
+が属すディレクトリで何らかの動作を実行する必要がある場合に 便利である。
+.TP 
+\fBFTW_DEPTH\fP
+セットされると、帰りがけ順探索 (post\-order traversal) を行う。 つまり、ディレクトリそのものを引き数とした \fIfn\fP()
+呼出しは、そのディレクトリに含まれるファイルとサブディレクトリに 対する処理の「後で」行われる
+(デフォルトでは、ディレクトリ自身の処理はディレクトリ内のエントリ より「前に」行なわれる)。
+.TP 
+\fBFTW_MOUNT\fP
+セットされると、同じファイルシステムの中だけを探索対象とする (つまり、マウントポイントをまたぐことはない)。
+.TP 
+\fBFTW_PHYS\fP
+セットされると、シンボリックリンクを辿らない (おそらくこちらが 通常望ましい動作だろう)。セットされていないとシンボリックリンクを
 辿るが、同じファイルが二回報告されることはない。
 .sp
-.\"O If \fBFTW_PHYS\fP is not set, but \fBFTW_DEPTH\fP is set,
-.\"O then the function
-.\"O .IR fn ()
-.\"O is never called for a directory that would be a descendant of itself.
-.B FTW_PHYS
-がセットされずに
-.B FTW_DEPTH
-がセットされると、自分自身に対するシンボリックリンクを配下に持つ
-ディレクトリに対して
-.IR fn ()
-が呼び出されることは決してない。
+\fBFTW_PHYS\fP がセットされずに \fBFTW_DEPTH\fP がセットされると、自分自身に対するシンボリックリンクを配下に持つ
+ディレクトリに対して \fIfn\fP()  が呼び出されることは決してない。
 .LP
-.\"O For each entry in the directory tree,
-.\"O .BR nftw ()
-.\"O calls
-.\"O .IR fn ()
-.\"O with four arguments.
-.\"O .I fpath
-.\"O and
-.\"O .I sb
-.\"O are as for
-.\"O .BR ftw ().
-.\"O .I typeflag
-.\"O may receive any of the same values as with
-.\"O .BR ftw (),
-.\"O or any of the following values:
-ディレクトリツリーのエントリ毎に、
-.BR nftw ()
-は 4つの引き数で
-.IR fn ()
-を呼び出す。
-.I fpath
-と
-.I sb
-は
-.BR ftw ()
-と同じである。
-.I typeflag
-には、
-.BR ftw ()
-で取り得る値のいずれか、または以下の値のいずれかが渡される:
-.TP
-.B FTW_DP
-.\"O .I fpath
-.\"O is a directory, and \fBFTW_DEPTH\fP was specified in \fIflags\fP.
-.\"O All of the files
-.\"O and subdirectories within \fIfpath\fP have been processed.
-.I fpath
-がディレクトリで、かつ
-.I flags
-で
-.B FTW_DEPTH
-が指定されていた。
-.I fpath
+ディレクトリツリーのエントリ毎に、 \fBnftw\fP()  は 4つの引き数で \fIfn\fP()  を呼び出す。 \fIfpath\fP と \fIsb\fP は
+\fBftw\fP()  と同じである。 \fItypeflag\fP には、 \fBftw\fP()  で取り得る値のいずれか、または以下の値のいずれかが渡される:
+.TP 
+\fBFTW_DP\fP
+\fIfpath\fP がディレクトリで、かつ \fIflags\fP で \fBFTW_DEPTH\fP が指定されていた。 \fIfpath\fP
 配下のファイルとサブディレクトリは全て処理が終わっている。
-.TP
-.B FTW_SL
-.\"O .I fpath
-.\"O is a symbolic link, and \fBFTW_PHYS\fP was set in \fIflags\fP.
-.I fpath
-がシンボリックリンクで、かつ \fBFTW_PHYS\fP が \fIflags\fP に
-セットされていた。
+.TP 
+\fBFTW_SL\fP
 .\" To obtain the definition of this constant from
 .\" .IR <ftw.h> ,
 .\" either
@@ -487,28 +164,13 @@ ftw, nftw \- ファイルツリーを歩きまわる
 .\" must be defined, or
 .\" .BR _XOPEN_SOURCE
 .\" must be defined with a value of 500 or more.
-.TP
-.B FTW_SLN
-.\"O .I fpath
-.\"O is a symbolic link pointing to a nonexistent file.
-.\"O (This occurs only if \fBFTW_PHYS\fP is not set.)
-.I fpath
-がシンボリックリンクで、存在しないファイルを指している
-(これがセットされるのは
-.B FTW_PHYS
+\fIfpath\fP がシンボリックリンクで、かつ \fBFTW_PHYS\fP が \fIflags\fP に セットされていた。
+.TP 
+\fBFTW_SLN\fP
+\fIfpath\fP がシンボリックリンクで、存在しないファイルを指している (これがセットされるのは \fBFTW_PHYS\fP
 がセットされていない場合だけである)。
 .LP
-.\"O The fourth argument that
-.\"O .BR nftw ()
-.\"O supplies when calling
-.\"O \fIfn\fP()
-.\"O is a structure of type \fIFTW\fP:
-.BR nftw ()
-が
-.IR fn ()
-を呼び出す際に渡す 4つめの引き数は
-.I FTW
-型の構造体である。
+\fBnftw\fP()  が \fIfn\fP()  を呼び出す際に渡す 4つめの引き数は \fIFTW\fP 型の構造体である。
 .in +4n
 .nf
 
@@ -519,156 +181,38 @@ struct FTW {
 
 .fi
 .in
-.\"O .I base
-.\"O is the offset of the filename (i.e., basename component)
-.\"O in the pathname given in
-.\"O .IR fpath .
-.\"O .I level
-.\"O is the depth of
-.\"O .I fpath
-.\"O in the directory tree, relative to the root of the tree
-.\"O .RI ( dirpath ,
-.\"O which has depth 0).
-.I base
-は、ファイル名 (basename 要素) の、
-.I fpath
-で渡されるパス名の中でのオフセットである。
-.I level
-はディレクトリツリーでの
-.I fpath
-の深さを示す。深さはディレクトリツリーのトップ (root) からの
-相対値である
-.RI ( dirpath
+\fIbase\fP は、ファイル名 (basename 要素) の、 \fIfpath\fP で渡されるパス名の中でのオフセットである。 \fIlevel\fP
+はディレクトリツリーでの \fIfpath\fP の深さを示す。深さはディレクトリツリーのトップ (root) からの 相対値である (\fIdirpath\fP
 は深さ 0 である)。
-.\"O .SH "RETURN VALUE"
 .SH 返り値
-.\"O These functions return 0 on success, and \-1 if an error occurs.
 これらの関数は、成功すると 0 を、エラーが発生すると \-1 を返す。
 
-.\"O If \fIfn\fP() returns nonzero,
-.\"O then the tree walk is terminated and the value returned by \fIfn\fP()
-.\"O is returned as the result of \fBftw\fP() or
-.\"O .BR nftw ().
-.IR fn ()
-が 0 以外を返した場合、ディレクトリツリーの探索を終了し、
-.IR fn ()
-が返した値を
-.BR ftw ()
-や
-.BR nftw ()
-の結果として返す。
+\fIfn\fP()  が 0 以外を返した場合、ディレクトリツリーの探索を終了し、 \fIfn\fP()  が返した値を \fBftw\fP()  や
+\fBnftw\fP()  の結果として返す。
 
-.\"O If
-.\"O .BR nftw ()
-.\"O is called with the \fBFTW_ACTIONRETVAL\fP flag,
-.\"O then the only nonzero value that should be used by \fIfn\fP()
-.\"O to terminate the tree walk is \fBFTW_STOP\fP,
-.\"O and that value is returned as the result of
-.\"O .BR nftw ().
-.BR nftw ()
-が
-.B FTW_ACTIONRETVAL
-フラグ付きで呼ばれた場合、ツリーの探索を終了させるために
-.IR fn ()
-が使用できる、非 0 の値は
-.B FTW_STOP
-だけであり、
-この値は
-.BR nftw ()
-の返り値として返される。
-.\"O .SH "CONFORMING TO"
+\fBnftw\fP()  が \fBFTW_ACTIONRETVAL\fP フラグ付きで呼ばれた場合、ツリーの探索を終了させるために \fIfn\fP()
+が使用できる、非 0 の値は \fBFTW_STOP\fP だけであり、 この値は \fBnftw\fP()  の返り値として返される。
 .SH 準拠
-POSIX.1-2001, SVr4, SUSv1.
-.\"O POSIX.1-2008 marks
-.\"O .BR ftw ()
-.\"O as obsolete.
-POSIX.1-2008 は
-.BR ftw ()
-を廃止予定としている。
-.\"O .SH NOTES
+POSIX.1\-2001, SVr4, SUSv1.  POSIX.1\-2008 は \fBftw\fP()  を廃止予定としている。
 .SH 注意
-.\"O POSIX.1-2001 note that the results are unspecified if
-.\"O .I fn
-.\"O does not preserve the current working directory.
-POSIX.1-2001 の注記によると、
-.I fn
-がカレントワーキングディレクトリを保持しなかった場合の
-結果は規定されていないとされている。
+POSIX.1\-2001 の注記によると、 \fIfn\fP がカレントワーキングディレクトリを保持しなかった場合の 結果は規定されていないとされている。
 .PP
-.\"O The function
-.\"O .BR nftw ()
-.\"O and the use of \fBFTW_SL\fP with
-.\"O .BR ftw ()
-.\"O were introduced in SUSv1.
-.BR nftw ()
-関数と、
-.BR ftw ()
-における
-.B FTW_SL
-は、SUSv1 で導入された。
+\fBnftw\fP()  関数と、 \fBftw\fP()  における \fBFTW_SL\fP は、SUSv1 で導入された。
 .LP
-.\"O On some systems
-.\"O .BR ftw ()
-.\"O will never use \fBFTW_SL\fP, on other systems \fBFTW_SL\fP occurs only
-.\"O for symbolic links that do not point to an existing file,
-.\"O and again on other systems
-.\"O .BR ftw ()
-.\"O will use \fBFTW_SL\fP for each symbolic link.
-.\"O For predictable control, use
-.\"O .BR nftw ().
-.BR ftw ()
-で
-.B FTW_SL
-を一切使わないシステムや、
-存在しないファイルを指しているシンボリックリンクの場合にのみ
-.B FTW_SL
-を使うシステム、また
-.BR ftw ()
-が全てのシンボリックリンクに対して
-.B FTW_SL
-を使うシステムもある。
-予測可能な動作をさせるためには、
-.BR nftw ()
-を使うこと。
+\fBftw\fP()  で \fBFTW_SL\fP を一切使わないシステムや、 存在しないファイルを指しているシンボリックリンクの場合にのみ \fBFTW_SL\fP
+を使うシステム、また \fBftw\fP()  が全てのシンボリックリンクに対して \fBFTW_SL\fP を使うシステムもある。
+予測可能な動作をさせるためには、 \fBnftw\fP()  を使うこと。
 .LP
-.\"O Under Linux, libc4 and libc5 and glibc 2.0.6 will
-.\"O use \fBFTW_F\fP for all objects (files, symbolic links, FIFOs, etc.)
-.\"O that can be stat'ed but are not a directory.
-Linux では、 libc4, libc5, glibc 2.0.6 は
-「stat できるがディレクトリではないオブジェクト」
-(ファイル, シンボリックリンク, fifo 等)
-に対してはすべて
-.B FTW_F
-を使う。
+Linux では、 libc4, libc5, glibc 2.0.6 は 「stat できるがディレクトリではないオブジェクト」 (ファイル,
+シンボリックリンク, fifo 等)  に対してはすべて \fBFTW_F\fP を使う。
 
-.\"O The function
-.\"O .BR nftw ()
-.\"O is available since glibc 2.1.
-.BR nftw ()
-関数は glibc 2.1 以降で利用できる。
+\fBnftw\fP()  関数は glibc 2.1 以降で利用できる。
 
-.\"O \fBFTW_ACTIONRETVAL\fP is glibc-specific.
-.B FTW_ACTIONRETVAL
-は glibc 固有である。
-.\"O .SH EXAMPLE
+\fBFTW_ACTIONRETVAL\fP は glibc 固有である。
 .SH 例
-.\"O The following program traverses the directory tree under the path named
-.\"O in its first command-line argument, or under the current directory
-.\"O if no argument is supplied.
-.\"O It displays various information about each file.
-.\"O The second command-line argument can be used to specify characters that
-.\"O control the value assigned to the \fIflags\fP
-.\"O argument when calling
-.\"O .BR nftw ().
-以下のプログラムは、一つ目のコマンドライン引き数を名前に持つパス以下の
-ディレクトリツリーを探索する。引き数が指定されなかった場合は、
-カレントディレクトリ以下を探索する。
-各々のファイルについて様々の情報が表示される。
-二番目のコマンドライン引き数に文字を指定することで、
-.BR nftw ()
-を呼び出す際に
-.I flags
-引き数に渡す値を制御することができる。
+以下のプログラムは、一つ目のコマンドライン引き数を名前に持つパス以下の ディレクトリツリーを探索する。引き数が指定されなかった場合は、
+カレントディレクトリ以下を探索する。 各々のファイルについて様々の情報が表示される。 二番目のコマンドライン引き数に文字を指定することで、
+\fBnftw\fP()  を呼び出す際に \fIflags\fP 引き数に渡す値を制御することができる。
 .nf
 
 #define _XOPEN_SOURCE 500
@@ -682,7 +226,7 @@ static int
 display_info(const char *fpath, const struct stat *sb,
              int tflag, struct FTW *ftwbuf)
 {
-    printf("%\-3s %2d %7jd   %\-40s %d %s\\n",
+    printf("%\-3s %2d %7jd   %\-40s %d %s\en",
         (tflag == FTW_D) ?   "d"   : (tflag == FTW_DNR) ? "dnr" :
         (tflag == FTW_DP) ?  "dp"  : (tflag == FTW_F) ?   "f" :
         (tflag == FTW_NS) ?  "ns"  : (tflag == FTW_SL) ?  "sl" :
@@ -710,8 +254,5 @@ main(int argc, char *argv[])
     exit(EXIT_SUCCESS);
 }
 .fi
-.\"O .SH "SEE ALSO"
 .SH 関連項目
-.BR stat (2),
-.BR fts (3),
-.BR readdir (3)
+\fBstat\fP(2), \fBfts\fP(3), \fBreaddir\fP(3)