1 .\" Copyright (C) 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" References consulted:
24 .\" Linux libc source code
25 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
27 .\" Modified Sat Jul 24 18:46:01 1993 by Rik Faith (faith@cs.unc.edu)
28 .\" Modified 11 June 1995 by Andries Brouwer (aeb@cwi.nl).
29 .\" 2007-07-30 Ulrich Drepper <drepper@redhat.com>: document fdopendir().
31 .\" Japanese Version Copyright (c) 1997 Seiichi Yoshida
32 .\" all rights reserved.
33 .\" Translated Fri Feb 14 14:53:20 JST 1997
34 .\" by Seiichi Yoshida <seiichi@muraoka.info.waseda.ac.jp>
35 .\" Updated & Modified Thu Feb 17 00:37:46 JST 2005
36 .\" by Yuichi SATO <ysato444@yahoo.co.jp>
38 .\"WORD: directory stream ディレクトリストリーム
40 .\"WORD: Permission denied アクセス権限がない
41 .\"WORD: file descriptor ファイルディスクリプタ
43 .TH OPENDIR 3 2010-06-20 "" "Linux Programmer's Manual"
46 .\"O opendir, fdopendir \- open a directory
47 opendir, fdopendir \- ディレクトリをオープンする
51 .B #include <sys/types.h>
53 .B #include <dirent.h>
55 .BI "DIR *opendir(const char *" name );
56 .BI "DIR *fdopendir(int " fd );
60 .\"O Feature Test Macro Requirements for glibc (see
61 .\"O .BR feature_test_macros (7)):
63 .RB ( feature_test_macros (7)
72 .\"O Since glibc 2.10:
74 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
76 .\"O Before glibc 2.10:
86 .\"O function opens a directory stream corresponding to the
87 .\"O directory \fIname\fP, and returns a pointer to the directory stream.
88 .\"O The stream is positioned at the first entry in the directory.
90 関数はディレクトリ \fIname\fP に対応する
91 ディレクトリストリームをオープンし、そのストリームへのポインタを返す。
92 ストリームの位置はディレクトリの先頭のエントリに設定される。
99 .\"O but returns a directory stream for the directory referred
100 .\"O to by the open file descriptor
102 .\"O After a successful call to
103 .\"O .BR fdopendir (),
105 .\"O is used internally by the implementation,
106 .\"O and should not otherwise be used by the application.
110 と同様だが、オープン済みのファイルディスクリプタ
117 は実装の内部で使用される。アプリケーションは
120 .\"O .SH "RETURN VALUE"
125 .\"O .BR fdopendir ()
126 .\"O functions return a pointer to the directory stream.
127 .\"O On error, NULL is returned, and
129 .\"O is set appropriately.
134 はディレクトリストリームへのポインタを返す。
142 .\"O Permission denied.
147 .\"O is not a valid file descriptor opened for reading.
149 が読み出し用にオープンされた、有効なファイルディスクリプタではない。
152 .\"O Too many file descriptors in use by process.
153 プロセスが使用中のファイルディスクリプタが多すぎる。
156 .\"O Too many files are currently open in the system.
157 システムでオープンされているファイルが多すぎる。
160 .\"O Directory does not exist, or \fIname\fP is an empty string.
161 ディレクトリが存在しないか、または \fIname\fP が空文字列である。
164 .\"O Insufficient memory to complete the operation.
168 .\"O \fIname\fP is not a directory.
169 \fIname\fP はディレクトリではない。
172 .\"O .BR fdopendir ()
173 .\"O is available in glibc since version 2.4.
175 は glibc 2.4 以降で利用可能である。
176 .\"O .SH "CONFORMING TO"
179 .\"O is present on SVr4, 4.3BSD, and specified in POSIX.1-2001.
181 は SVr4 と 4.3BSD に存在し、
182 POSIX.1-2001 で規定されている。
183 .\"O .BR fdopendir ()
184 .\"O is specified in POSIX.1-2008.
186 は POSIX.1-2008 で規定されている。
189 .\"O The underlying file descriptor of the directory stream can be obtained using
191 ディレクトリストリームに対応するファイルディスクリプタは
197 .\"O function sets the close-on-exec flag for the file descriptor underlying the
200 .\"O .BR fdopendir ()
201 .\"O function leaves the setting of the close-on-exec
202 .\"O flag unchanged for the file descriptor,
207 の背後にあるファイルディスクリプタの close-on-exec フラグを設定する。
209 関数は、ファイルディスクリプタの close-on-exec フラグの設定を変更しない。
210 .\"O POSIX.1-200x leaves it unspecified whether a successful call to
211 .\"O .BR fdopendir ()
212 .\"O will set the close-on-exec flag for the file descriptor,
215 の呼び出しが成功した際に、ファイルディスクリプタ
217 の close-on-exec を設定するかどうかは、
218 POSIX.1-200x では規定されていない。