名前
closedir - ディレクトリをクローズする
書式
#include <sys/types.h>
#include <dirent.h>
int closedir(DIR *dir);
説明
closedir() 関数は dir に関連付けられた ディレクトリストリームをクローズする。 ディレクトリストリームディスクリプター (directory stream descriptor) dir は、 この呼び出しの後では使用することができない。
返り値
closedir() 関数は成功時に 0 を返す。 エラーの場合は、-1 が返されて、 errno が適切に設定される。
エラー
EBADF | ディレクトリストリームディスクリプター dir が無効である。 |
準拠
SVr4, POSIX.1-2001, 4.3BSD
関連項目
close(2), opendir(3), readdir(3), rewinddir(3), scandir(3), seekdir(3), telldir(3)