Function Reference


_WinAPI_PathMatchSpec

Searches a string using a Microsoft MS-DOS wild card match type

#include <WinAPIShPath.au3>
_WinAPI_PathMatchSpec ( $sFilePath, $sSpec )

Parameters

$sFilePath The path to be searched.
$sSpec The file type for which to search. For example, to test whether $sFilePath is a .doc file,
$sSpec should be set to "*.doc".

Return Value

Success: True - The string matches.
Failure: False.

See Also

Search PathMatchSpec in MSDN Library.

Example

#include <Array.au3>
#include <File.au3>
#include <WinAPIShPath.au3>

_Example()
Func _Example()
        Local $aFileList = _FileListToArray(@SystemDir, '*.dll', 1)
        Local $aSortList[UBound($aFileList) - 1]
        Local $iCount = 0

        For $i = 1 To $aFileList[0]
                If _WinAPI_PathMatchSpec($aFileList[$i], 'net*.dll') Then
                        $aSortList[$iCount] = $aFileList[$i]
                        $iCount += 1
                EndIf
        Next
        If $iCount Then
                ReDim $aSortList[$iCount]
        Else
                Exit
        EndIf

        _ArrayDisplay($aSortList, '_WinAPI_PathMatchSpec')

EndFunc   ;==>_Example