UDF > WinAPIEx > ShellPath >


_WinAPI_PathMatchSpec

Détermine si un chemin matche un modèle avec des caractères génériques de type Microsoft MS-DOS

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

Paramètres

$sFilePath Le chemin dans lequel rechercher.
$sSpec Le type de fichier à rechercher. Par exemple, pour tester si $sFilePath est un fichier doc, $sSpec doit être défini à "*.doc".

Valeur de retour

Succès: Retourne True - La chaîne correspond.
Échec: Retourne False.

Voir aussi

Consultez PathMatchSpec dans la librairie MSDN.

Exemple

#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]
            _ArrayDisplay($aSortList, '_WinAPI_PathMatchSpec')
    EndIf

EndFunc   ;==>_Example