findclose, _wfindclose
Go Up to dir.h Index
Header File
dir.h
Category
Directory Control Routines
Prototype
int findclose(struct ffblk *ffblk );
int _wfindclose(struct _wffblk *ffblk );
Description
findclose closes any handles and frees up any dynamic memory associated with previous calls to findfirst and findnext.
Return Value
findclose returns 0 on successfully closing the handle. On failure:
- -1 is returned
- errno is set to
|
EINVDAT |
Invalid data |
Example
#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);
}
Portability
| POSIX | Win32 | ANSI C | ANSI C++ | |
|---|---|---|---|---|
|
findclose |
+ |
|||
|
_wfindclose |
NT only |