HB_FileMatch
Makes a DOS style file mask comparison
Syntax
HB_FileMatch( <cFile>, <cPattern> ) -> <lMatch>
Argument
<cFile> : File name to compare
<cPattern> : File mask; file specification including wildcard characters ( *, ? )
Returns
<lMatch> : .T. if <cFile> matche with <cPattern>, else .F:
Description
This func makes a DOS style widcard comparison between given filename and mask (skeleton).
BTW HB_DirScan() uses internally HB_FileMatch().
Example
LOCAL cTestFName := "C:\temp\test.tmp" ? 'File ', FILE( cTestFName ) // .T. ? 'C ', HB_FileMatch( cTestFName, 'C' ) // .F. ? ': ', HB_FileMatch( cTestFName, ':' ) // .F. ? 'C: ', HB_FileMatch( cTestFName, 'C:' ) // .F. ? 'temp ', HB_FileMatch( cTestFName, 'temp' ) // .F. ? '*temp ', HB_FileMatch( cTestFName, '*temp' ) // .F. ? '*temp*', HB_FileMatch( cTestFName, '*temp*' ) // .T. ? 'test ', HB_FileMatch( cTestFName, 'test' ) // .F. ? '.tmp ', HB_FileMatch( cTestFName, '.tmp' ) // .F. ? '*tmp ', HB_FileMatch( cTestFName, '*tmp' ) // .T.
Seealso