findclose, _wfindclose
Nach oben zu dir.h - Index
Header-Datei
dir.h
Kategorie
Verzeichnisbearbeitungsroutinen
Prototyp
int findclose(struct ffblk *ffblk );
int _wfindclose(struct _wffblk *ffblk );
Beschreibung
findclose schließt alle Handle und gibt den gesamten dynamischen Speicher frei, der vorherigen Aufrufen von findfirst und findnext zugeordnet ist.
Rückgabewert
findclose gibt 0 zurück, wenn das Handle geschlossen wurde. Im Fehlerfall gilt:
- -1 wird zurückgegeben,
- errno wird folgender Wert zugewiesen:
|
EINVDAT |
Invalid data (Ungültige Daten) |
Beispiel
#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);
}
Portabilität
| POSIX | Win32 | ANSI C | ANSI C++ | |
|---|---|---|---|---|
|
findclose |
+ |
|||
|
_wfindclose |
Nur NT |