(C) 1998 AROS - The Amiga Research OS


NAME
#include <dos/dosasl.h>
#include <proto/dos.h>

LONG MatchFirst (pat , AP )

LOCATION
In DOSBase at offset 137

SYNOPSIS
STRPTR pat
struct AnchorPath * AP

FUNCTION
Searches for the first file or directory that matches a given pattern. MatchFirst() initializes the AnchorPath structure for you but you must initilize the following fields: ap_Flags, ap_Strlen, ap_BreakBits and ap_FoundBreak. The first call to MatchFirst() also passes you the first matching file which you can examine in ap_Info and the directory the files is in in ap_Current->an_Lock. After the first call to MatchFirst() call MatchNext(). The search begins whereever the current directory is set to. See CurrentDir(); For more info on patterns see ParsePattern().

INPUTS
pat
pattern to search for
AP
pointer to (initilized) AnchorPath structure
RESULT
0 = success other = DOS error code

EXAMPLE

SEE ALSO
MatchNext(), MatchEnd(), ParsePattern(), Examine(), CurrentDir() <dos/dosasl.h>

NOTES

BUGS
Copying of the relative path to ap_Buf is not implemented yet

INTERNALS

HISTORY
17.02.1999 bergers
Revision of these functions. Multiple subdirectories are handled correctly. Assigns are also taken care of.
20.10.1998 hkiel
Amiga Research OS
29.04.1998 bergers
Implementation of these functions.
27.01.1997 ldp
Polish
09.12.1996 aros
Added empty templates for all missing functions

Moved #include's into first column