#define INCL_DOSFILEMGR USHORT rc = DosFindClose(DirHandle); HDIR DirHandle; /* Directory search handle */ USHORT rc; /* return code */
Example
This example searches for a file, then closes the search.
#define INCL_DOSFILEMGR #define SEARCH_PATTERN "*.*" #define FILE_ATTRIBUTE 0 #define RESERVED 0L HDIR FindHandle; FindHandle = 0x0001; FindCount = 1; rc = DosFindFirst(SEARCH_PATTERN, /* File pattern */ &FindHandle, /* Directory search handle */ FILE_ATTRIBUTE, /* Search attribute */ &FindBuffer, /* Result buffer */ sizeof(FindBuffer), /* Result buffer length */ &FindCount, /* # of entries to find */ RESERVED); /* Reserved (must be zero) */ rc = DosFindClose(FindHandle); /* Directory search handle */