Analyse un chemin et retourne la partie de ce chemin qui suit la premi�re barre oblique inverse
#include <WinAPIShPath.au3>
_WinAPI_PathFindNextComponent ( $sFilePath )
$sFilePath | Le chemin � analyser. Les composantes du chemin sont d�limit�s par des barres obliques invers�es. Par exemple, le chemin d'acc�s "c:\path1\path2\file.txt" comporte quatre composantes: c:, path1, path2, et file.txt. |
Succ�s: | Retourne le chemin tronqu�. |
�chec: | Retourne la cha�ne vide et d�finit @error <> 0. |
Cette fonction avance dans la cha�ne de chemin jusqu'� ce qu'elle rencontre une barre oblique inverse ("\"), ignore tout jusqu'� ce point, y compris la barre oblique inverse, et retourne le reste du chemin. Par cons�quent, si un chemin commence par une barre oblique inverse (comme \path1\path2), la fonction supprime simplement la barre oblique inverse et retourne le reste (path1\path2).
Consultez PathFindNextComponent dans la librairie MSDN.
#include <WinAPIShPath.au3> Local $sPath = @ScriptFullPath While $sPath <> "" ConsoleWrite($sPath & @CRLF) $sPath = _WinAPI_PathFindNextComponent($sPath) WEnd $sPath = _WinAPI_PathFindNextComponent("") ConsoleWrite('Chemin = " '& $sPath & '" -> @error = ' & @error & @CRLF)