_findfirst, __wfindfirst

From RAD Studio
Jump to: navigation, search

Go Up to io.h Index

Header File

io.h, wchar.h

Category

Directory Control Routines

Prototype

long _findfirst(char *filter, struct _finddata_t *fileinfo);

long __wfindfirst(wchar_t *filter, struct _wfinddata_t *fileinfo);

Description

Begins a search of a disk directory to find information about the first instance of a filename that matches a specified filter. The filter parameter is a string that specifies which files to return. Wildcards may be used in the filter. The fileinfo parameter is the file information buffer. If a matching file is found, the fileinfo structure is filled with the file-directory information.

These functions are provided for Microsoft compatibility.

Return Value

On success, returns a unique search handle to a file or group of files matching the filter specification.

Otherwise, returns –1 and sets errno to one of the following values:

ENOENTPath or file name not found

EINVALInvalid filename specification

Portability

POSIX Win32 ANSI C ANSI C++
_findfirst +
__wfindfirst NT only

See Also