Code: Select all
Paths :=
(
"C:\abc.d
C:\mbc.d
C:\dbc.d
C:\Fil1\Dele.e
C:\Fil1\Delema.d
C:\Fil1\File2\Deledmad.d
C:\Fil1\File2\Alada.d
C:\Fil3\mada.d
C:\Fil3\madaf.d
"
)
Paths := StrSplit(Paths,"`n")
T := 0
TO := {}
For, K,V in Paths
{
SplitPath,V,FName,Dir
DirUpDir := (SubStr(Dir,StrLen(Dir),1) = "\" ? SubStr(Dir,1,StrLen(Dir) -1) : Dir) ;Dizinin bir alt dizinini bulur, Sonda fazladan / karakteri olup olmamasını dikkate alır
SplitPath,DirUpDir,,DirUpDir
if(Dir == "")
Continue
Dir := Dir . "\"
DirUpDir := DirUpDir . "\"
if(TO.HasKey(DirUpDir) == false){
TO[Dir] := 1
NewDir := 1
}
if(TO.HasKey(Dir) == false){
TO[Dir] := TO[DirUpDir] + 1
NewDir := 1
Firsts := 1
}
if(Dir == DirBack || Firsts := 1 || A_Index == 1)
{
if(NewDir == 1)
{
Loop, % TO[Dir]
Stack .= "`t"
Stack .= Dir "`n"
NewDir := 0
}
Loop, % TO[Dir] + 1
Stack .= "`t"
Stack .= Dir . FName "`n"
Firsts := 0
}
}
MsgBox % Stack