_findclose
io.h:インデックス への移動
ヘッダー
io.h
カテゴリ
ディレクトリ制御ルーチン
プロトタイプ
int _findclose(long handle);
説明
指定された検索ハンドルを閉じ、前の findfirst/findnext の呼び出しに関連付けられたリソースを解放します。この handle パラメータは、前の _findfirst の呼び出しによって返された検索ハンドルです。
この関数は、Microsoft との互換性のために提供されています。
コード例
#include <io.h>
void print_dir(wchar_t* dir_name)
{
/* Open a find stream (_wfinddata_t and a find handle) */
_wfinddata_t find_data;
long handle = __wfindfirst(dir_name, &find_data);
/* Check for errors */
if (!handle)
return;
/* Scan all files that match */
do
{
printf("%ls\n", find_data.name);
} while (!__wfindnext(handle, &find_data));
/* Close the find handle */
_findclose(handle);
}
戻り値
成功した場合は 0 を返します。
そうでない場合は -1 を返し、errno を次の値に設定します。
ENOENT - ファイル指定が一致しない
移植性
| POSIX | Win32 | ANSI C | ANSI C++ | |
|---|---|---|---|---|
|
_findclose |
+ |