findclose、_wfindclose
dir.h:インデックス への移動
ヘッダー
dir.h
カテゴリ
ディレクトリ制御ルーチン
プロトタイプ
int findclose(struct ffblk *ffblk );
int _wfindclose(struct _wffblk *ffblk );
説明
findclose は、すべてのハンドルを閉じ、以前の findfirst と findnext の呼び出しに関連付けられた動的メモリを解放します。
戻り値
ハンドルを正常に閉じた場合、findclose は 0 を返します。失敗した場合は
- -1 を返します。
- errno を次の値に設定します。
EINVDAT |
Invalid data(無効なデータ) |
コード例
#include <stdio.h> #include <dir.h> void print_dir(wchar_t* dir_name) { /* Open a find stream (_wfinddata_t and a find handle) */ _wffblk find_data; int done; done = _wfindfirst(dir_name, &find_data, 0); /* Scan all files that mach */ while (!done) { printf("%ls\n", find_data.ff_name); done = _wfindnext(&find_data); } /* Close the find handle */ _wfindclose(&find_data); }
移植性
POSIX | Win32 | ANSI C | ANSI C++ | |
---|---|---|---|---|
findclose |
+ |
|||
_wfindclose |
NT のみ |