| FFindFirst | Function (ROM Call 0x3D9)

AMS 2.00 or higher | files.h

SYM_ENTRY *FFindFirst (unsigned short Options, const char *typeName, const char *folderName);

Find the first file of a given type.

FFindFirst finds the first file of the type typeName and returns a SYM_ENTRY pointer to it (or NULL if none found). typeName must point to a normal zero-terminated C string (i.e. not a tokenized form) of at most four characters which describes the file type. Use FFindNext to find subsequent entries, NULL will be returned after the last entry is found.
Options can be one of the following flags as described in the FindOptions enum:

FO_NONE | When this flag is set, folderName is a string pointer to the folder to search.
FO_RECURSE | When this flag is set, FFindFirst searches all folders (folderName is ignored).

FFindFirst returns a SYM_ENTRY pointer to the first file with a type matching typeName or NULL if none found. The Name field of the SYM_ENTRY contains the name of the file being searched for as an 8 character string. If using FO_RECURSE, then calling SymFindFolderName will return the folder of the symbol just found.
Note: SYM_ENTRY pointers are only valid until heap compression is done or another symbol is added to the symbol table.

Uses: FFindNext, HToESI, strcmp, strlen, ROM Call 0x3E8, StrToTokN, SymFindFirst

See also: FFindNext, SymFindFolderName