UDF > WinAPIEx > ShellPath >


_WinAPI_PathFindFileName

Extrait le nom du fichier d'un chemin

#include <WinAPIShPath.au3>
_WinAPI_PathFindFileName ( $sFilePath )

Paramètre

$sFilePath Le chemin à traiter.

Valeur de retour

Retourne la chaîne qui contient le nom du fichier.
Sinon, le paramètre d'origine $sFilePath.

Voir aussi

Consultez PathFindFileName dans la librairie MSDN.

Exemple

#include <WinAPIShPath.au3>

Local $aPath[7] = ['c:\path\file', 'c:\path', 'c:\path\', 'c:\', 'c:', 'path', StringFormat('Long String %270s', '1')]

For $i = 0 To UBound($aPath) - 2
    ConsoleWrite($aPath[$i] & '=> ' & _WinAPI_PathFindFileName($aPath[$i]) & @CRLF)
Next

Local $iRet = _WinAPI_PathFindFileName($aPath[UBound($aPath) - 1])
ConsoleWrite('@error = ' & @error & '=> "' & $iRet & '"' & @CRLF)