#156488 - 2006-02-02 01:51 PM
Re: Compare contents directory
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
There are recursive DIRs available in the UDF forum - a quich search should turn these up.
The process is actually pretty simple.
- Get a recursive list of master dir
- Get a recursive list of slave dir
- Sort both - the Qsort() udf is good for this
- Compare the lists side-by-side. If entry in list1 > entry in list2 then entry is missing from list 1 and vice-versa.
|
Top
|
|
|
|
#156490 - 2006-02-02 02:49 PM
Re: Compare contents directory
|
maciep
Korg Regular
Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
|
|
Top
|
|
|
|
#156491 - 2006-02-02 02:53 PM
Re: Compare contents directory
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
And here is an example of how you can compare the two lists once they are sorted: Code:
Break ON udfCompare(Split("a b d2 c e"),Split("b d1 e f g h")) Function udfCompare($avList1,$avList2) Dim $iIndex1,$iIndex2 $iIndex1=0 $iIndex2=0 While $iIndex1<=UBound($avList1) OR $iIndex2<=UBound($avList2) Select Case $iIndex1>UBound($avList1) $udfCompare=$udfCompare+@CRLF+$avList2[$iIndex2]+" missing from list 1" $iIndex2=$iIndex2+1 Case $iIndex2>UBound($avList2) $udfCompare=$udfCompare+@CRLF+$avList1[$iIndex1]+" missing from list 2" $iIndex1=$iIndex1+1 Case $avList1[$iIndex1] > $avList2[$iIndex2] $udfCompare=$udfCompare+@CRLF+$avList2[$iIndex2]+" missing from list 1" $iIndex2=$iIndex2+1 Case $avList2[$iIndex2] > $avList1[$iIndex1] $udfCompare=$udfCompare+@CRLF+$avList1[$iIndex1]+" missing from list 2" $iIndex1=$iIndex1+1 Case "Match" $iIndex1=$iIndex1+1 $iIndex2=$iIndex2+1 EndSelect Loop $udfCompare=SubStr($udfCompare,3) EndFunction
|
Top
|
|
|
|
#156493 - 2006-02-02 03:16 PM
Re: Compare contents directory
|
maciep
Korg Regular
Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
|
it's not in my favorites...as of now.
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 255 anonymous users online.
|
|
|