Guten Morgen!
nuts
Super Idee
Habe ich sofort umgesetzt schlüssel war
StringRegExp($_F_N_, StringReplace(StringReplace($_Wildc_, '*', ''), ',', '|'))
[/autoit]
Post#1 update
LG Kleinr
Guten Morgen!
nuts
Super Idee
Habe ich sofort umgesetzt schlüssel war
StringRegExp($_F_N_, StringReplace(StringReplace($_Wildc_, '*', ''), ',', '|'))
[/autoit]
Post#1 update
LG Kleinr
Morgen!
AspirinJunkie
Dynamischen Datenstruktur ist schon wichtig habe meine Func mit String umgebaut.
Mir kam es darauf an so schnell wie möglich zu werden was ich auch mit eurer hilfe geschaft habe.
Die Funktion übertrift meine erwartungen ich habe mir nicht vorstellen könne das AutoIT so schnell sien kann.
Wie du schon selber geschrieben hast so viele ansätze Ideen der umsetzung einfach schön zu sehen vieviel leute sich um das Rkursiv gedanken machen!
Hat mir sehr viel spass gemacht wenn du oder jemand noch ideen hat dann immer her damit. ![]()
FileList_S_Rekursiv in Post#1
LG Kleiner
Bin auch mal wieder hir!
AspirinJunkie
Tatsächlich meine alte Func hat auf ein Bestehendes array abgezielt!
Noch mal überarbeitet .
Und das mit den 8-stellige Hex-Zahlen war ein test.
PS: Wenn du progandy und meine func antreten llassen willst dann bitte auf gleicher bassis denn in unser Func ist noche ein zusatz, bei progandy ( __FLTAEx_FileIsSymlink) und bei mir ( _F_L_) das
ist eine Func zum prüfen von Symlink die eine Schleife verursacht.
Post#1
LG Kleiner
Moin!
Schöne Idee !
LG Kleiner
Update
Hi Leute einmal überarbeitet!
1-lauf 19000 Datein in 6,4 sec
2-lauf 19000 Datein in 1,4 sec
Post#1
LG Kleiner
Guten Morgen!
Sehr schön, mal wieder ein schritt vor raus! ![]()
LG Kleiner
Guten Morgen!
Welches Betriebsystem hast du?
LG Kleiner
Danke Euch Beiden!
@TheShadowAE
Mit der RegFunc bin ich noch auf Kriegsfuss, wenn man die root strucktur auslesen will dauert es doch schon sehr lange!
LG Kleier
Guten Mogen PrideRage!
Habe dien Code gerade getestet, leider werden bei mir keine Datein Kopiert nur ein Backup Verzeichnis wird angelegt!
Ausserdem kann man nicht wählen wohin man kopieren möchte, es bleibt einen nur eine möglichkeit
LG Kleiner!
Update
Post#1
LG Kleiner
Hallo Leute!
Ich Poste meine Rekursiv werke ( Datein / Verzeichnise / Reg ) Listen!
Vieleicht Kann sie wehr gebrauchen u. o einer hat noch vorschläge Ideen Erweiterungen! ![]()
_Files_list_Rekursiv
;#RequireAdmin
#include-once
#include <File.au3>
#include <Array.au3>
;==============================================================================================================================#
;~ Function Name....: _FilesListRekursiv()
;
;~ Description......: Auflistung von Dateien
;
;~ $_a_Pfad_........: Pfad
;~ $_Set_Runde_.....: '1' ( Standart ) wie oft die Funktion aufgerufen wird ( beispiel C:\ & D:\ durchsuchen auf 2 setzen )
;~ $a_Wildcards_....: '*' ( Standart ) Suchbegrif u. o. Wildcards
;
;~ Return Value(s)..: Array ( Standard ) mit den gefundenen Dateien Array[0] endhält die anzahl ( Fund )
;
;~ Author(s)........: Kleiner27 (http://www.autoit.de) # 27.03.2010 09:00 #
;==============================================================================================================================#
Local $Runde_
Local $a_Pfad_
Local $_x_Files_
Local $_x_Files_Next_
Local $_U_ = 0x00000000
Local $_a_A_Save_[0x000F423F]
Local $_a_Zaehler_ = 0x00000001
Local $_Tren_[0x00000003] = [Chr(0x00000020), Chr(0x0000002A), Chr(0x0000005C)]
Dim $iTimer = TimerInit()
Dim $d = _FilesListRekursiv('E:', 0, '*')
_ArrayDisplay($d, TimerDiff($iTimer))
Func _FilesListRekursiv($_a_Pfad_, $_Set_Runde_ = True, $a_Wildcards_ = True)
If (StringRight($_a_Pfad_, 0x00000001) <> $_Tren_[0x00000002]) Then $_a_Pfad_ = ($_a_Pfad_ & $_Tren_[0x00000002])
If ($_Set_Runde_ = $_Tren_[0x00000000] Or $_Set_Runde_ = 0x00000000) Then $_Set_Runde_ = (0x00000001)
If ($a_Wildcards_ = $_Tren_[0x00000000]) Then $a_Wildcards_ = ($_Tren_[1])
If ($_U_ < $Runde_) Then ReDim $_a_A_Save_[0x000F423F]
$_U_ += 0x00000001
_ShowFilesRekursiv($_a_Pfad_, $a_Wildcards_)
$Runde_ = ($_U_)
Switch ($Runde_)
Case ($_Set_Runde_)
ReDim $_a_A_Save_[$_a_Zaehler_]
$_a_A_Save_[0x00000000] = ($_a_Zaehler_)
$_a_Zaehler_ = 0x00000001
$_U_ = 0x00000000
Return ($_a_A_Save_)
EndSwitch
Return ($_a_A_Save_)
EndFunc ;==>_FilesListRekursiv
Func _ShowFilesRekursiv($_a_Pfad_, $a_Wildcards_)
$_x_Files_ = FileFindFirstFile($_a_Pfad_ & $a_Wildcards_)
If ($_x_Files_ <> -0x00000001) Then
Do
$_x_Files_Next_ = FileFindNextFile($_x_Files_)
If @error Then ExitLoop
If (@extended = 0x00000001) Then ContinueLoop
$_a_A_Save_[$_a_Zaehler_] = ($_a_Pfad_ & $_x_Files_Next_)
$_a_Zaehler_ += 0x00000001
Until False
FileClose($_x_Files_)
EndIf
Dim $a_Verzeichnis_ = _FileListToArray($_a_Pfad_, $_Tren_[0x00000001], 0x00000002)
For $_i_ = 0x00000001 To UBound($a_Verzeichnis_) - 0x00000001
If (_File_Link_($_a_Pfad_ & $a_Verzeichnis_[$_i_]) = True) Then ContinueLoop
_ShowFilesRekursiv(String($_a_Pfad_ & $a_Verzeichnis_[$_i_] & $_Tren_[0x00000002]), $a_Wildcards_)
Next
EndFunc ;==>_ShowFilesRekursiv
Func _File_Link_($_sF_Link_)
Dim $_a_K_32_ = DllOpen('kernel32.dll')
Dim $_D_Array_ = DllCall($_a_K_32_, 'dword', 'GetFileAttributesW', 'wstr', $_sF_Link_)
If (@error) Then Return SetError(0x00000000, @error, 0x00000000)
Return BitAND($_D_Array_[0x00000000], 0x00000400) = 0x00000400
EndFunc ;==>_File_Link_
_Folder_list_Rekursiv
;#RequireAdmin
#include-once
#include <File.au3>
#include <Array.au3>
;==============================================================================================================================#
;~ Function Name....: _FolderListRekursiv()
;
;~ Description......: Auflistung von Verzeichnise
;
;~ $_a_Pfad_........: Pfad
;~ $_Set_Runde_.....: '1' ( Standart ) wie oft die Funktion aufgerufen wird ( beispiel C:\ & D:\ durchsuchen auf 2 setzen )
;~ $a_Wildcards_....: '*' ( Standart ) Suchbegrif u. o. Wildcards
;
;~ Return Value(s)..: Array ( Standard ) mit den gefundenen Dateien Array[0] endhält die anzahl ( Fund )
;
;~ Author(s)........: Kleiner27 (http://www.autoit.de) # 27.03.2010 09:00 #
;==============================================================================================================================#
Local $Runde_
Local $a_Pfad_
Local $stringSplit
Local $_U_ = 0x00000000
Local $_a_A_Save_[0x000F423F]
Local $_a_Zaehler_ = 0x00000001
Local $_Tren_[0x00000004] = [Chr(0x00000020), Chr(0x0000002A), Chr(0x0000005C), Chr(46)]
Dim $iTimer = TimerInit()
Dim $d = _FolderListRekursiv('D:', 0, '*')
_ArrayDisplay($d, TimerDiff($iTimer))
Func _FolderListRekursiv($_a_Pfad_, $_Set_Runde_ = True, $a_Wildcards_ = True)
If (StringRight($_a_Pfad_, 0x00000001) <> $_Tren_[0x00000002]) Then $_a_Pfad_ = ($_a_Pfad_ & $_Tren_[0x00000002])
If ($_Set_Runde_ = $_Tren_[0x00000000] Or $_Set_Runde_ = 0x00000000) Then $_Set_Runde_ = (0x00000001)
If ($a_Wildcards_ = $_Tren_[0x00000000]) Then $a_Wildcards_ = ($_Tren_[1])
If ($_U_ < $Runde_) Then ReDim $_a_A_Save_[0x000F423F]
$_U_ += 0x00000001
_ShowFolderRekursiv($_a_Pfad_, $a_Wildcards_)
$Runde_ = ($_U_)
Switch ($Runde_)
Case ($_Set_Runde_)
ReDim $_a_A_Save_[$_a_Zaehler_]
$_a_A_Save_[0x00000000] = ($_a_Zaehler_)
$_a_Zaehler_ = 0x00000001
$_U_ = 0x00000000
Return ($_a_A_Save_)
EndSwitch
Return ($_a_A_Save_)
EndFunc ;==>_FolderListRekursiv
Func _ShowFolderRekursiv($_a_Pfad_, $a_Wildcards_)
If ($a_Wildcards_ <> $_Tren_[0x00000001]) Then
$stringSplit = StringSplit($_a_Pfad_, $_Tren_[0x00000002])
If (StringReplace(StringReplace($a_Wildcards_, $_Tren_[0x00000001], $_Tren_[0x00000000]), $_Tren_[0x00000003], $_Tren_[0x00000000]) = $stringSplit[UBound($stringSplit) - 2]) Then
$_a_A_Save_[$_a_Zaehler_] = ($_a_Pfad_)
$_a_Zaehler_ += 0x00000001
EndIf
Else
$_a_A_Save_[$_a_Zaehler_] = ($_a_Pfad_)
$_a_Zaehler_ += 0x00000001
EndIf
Dim $a_Verzeichnis_ = _FileListToArray($_a_Pfad_, $_Tren_[0x00000001], 0x00000002)
For $_i_ = 0x00000001 To UBound($a_Verzeichnis_) - 0x00000001
If (_File_Link_($_a_Pfad_ & $a_Verzeichnis_[$_i_]) = True) Then ContinueLoop
_ShowFolderRekursiv(String($_a_Pfad_ & $a_Verzeichnis_[$_i_] & $_Tren_[0x00000002]), $a_Wildcards_)
Next
EndFunc ;==>_ShowFolderRekursiv
Func _File_Link_($_sF_Link_)
Dim $_a_K_32_ = DllOpen('kernel32.dll')
Dim $_D_Array_ = DllCall($_a_K_32_, 'dword', 'GetFileAttributesW', 'wstr', $_sF_Link_)
If (@error) Then Return SetError(0x00000000, @error, 0x00000000)
Return BitAND($_D_Array_[0x00000000], 0x00000400) = 0x00000400
EndFunc ;==>_File_Link_
_Files_list_Rekursiv_Dubell
;#RequireAdmin
#include-once
#include <Array.au3>
#include <File.au3>
#include <String.au3>
;==============================================================================================================================#
;~ Function Name....: _File_List_Dubell()
;
;~ Description......: Auflistung von Dateien
;
;~ $_a_Pfad_........: Pfad
;~ $_Set_Runde_.....: '1' ( Standart ) wie oft die Funktion aufgerufen wird ( beispiel C:\ & D:\ durchsuchen auf 2 setzen )
;~ $a_Wildcards_....: '*' ( Standart ) Suchbegrif u. o. Wildcards
;
;~ Return Value(s)..: Array ( Standard ) mit den gefundenen Dateien Array[0] endhält die anzahl ( Fund )
;
;~ Author(s)........: Kleiner27 (http://www.autoit.de) # 27.03.2010 09:00 #
;==============================================================================================================================#
Local $_U_
Local $Runde_
Local $_a_S_Save_
Local $_a_X_File_
Local $_a_X_File_Next_
Local $_0_ = 0x00000000
Local $_1_ = 0x00000000
Local $_a_A_ArraySave_[0x000F423F][0x0000002]
Local $_a_B_ArraySave_[0x000F423F][0x0000002]
Local $_a_Tren_[0x00000004] = [Chr(0x00000020), Chr(0x0000002A), Chr(0x0000005C), Chr(0x0000007C)]
Dim $iTimer = TimerInit()
Dim $F = _File_List_Dubell('D:', 0, '*')
_ArrayDisplay($F, TimerDiff($iTimer))
Func _File_List_Dubell($a_Pfad_, $_Set_Runde_ = True, $a_Wildcards_ = True)
If (StringRight($a_Pfad_, 0x00000001) <> $_a_Tren_[0x00000002]) Then $a_Pfad_ = ($a_Pfad_ & $_a_Tren_[0x00000002])
If ($_Set_Runde_ = $_a_Tren_[0x00000000] Or $_Set_Runde_ = 0x00000000) Then $_Set_Runde_ = (0x00000001)
If ($a_Wildcards_ = $_a_Tren_[0x00000000]) Then $a_Wildcards_ = ($_a_Tren_[1])
If ($_U_ < $Runde_) Then
ReDim $_a_B_ArraySave_[0x000F423F][0x00000002]
ReDim $_a_A_ArraySave_[0x000F423F][0x00000002]
EndIf
$_U_ += 0x00000001
_Show_Dubell_($a_Pfad_, $a_Wildcards_)
If ($_0_ = 0x00000000) Then Return SetError(0x00000002, 0x00000000, $_a_Tren_[0x00000000])
$Runde_ = ($_U_)
Switch ($Runde_)
Case ($_Set_Runde_)
ReDim $_a_A_ArraySave_[$_0_][0x00000002]
_ArraySort($_a_A_ArraySave_, 0x00000000, 0x00000000, 0x00000000, 0x00000000)
_Dubell_List_($_a_A_ArraySave_, $_0_)
If ($_1_ = 0x00000000) Then Return SetError(0x00000002, 0x00000000, $_a_Tren_[0x00000000])
ReDim $_a_B_ArraySave_[$_1_][0x00000002]
$_0_ = 0x00000000
$_1_ = 0x00000000
Return ($_a_B_ArraySave_)
EndSwitch
Return ($_a_B_ArraySave_)
EndFunc ;==>_File_List_Dubell
Func _Show_Dubell_($a_Pfad_, $a_Wildcards_)
$_a_X_File_ = FileFindFirstFile($a_Pfad_ & $a_Wildcards_)
If ($_a_X_File_ <> -0x00000001) Then
Do
$_a_X_File_Next_ = FileFindNextFile($_a_X_File_)
If (@error) Then ExitLoop
If (@extended = 0x00000001) Then ContinueLoop
$_a_A_ArraySave_[$_0_][0x00000000] = ($_a_X_File_Next_)
$_a_A_ArraySave_[$_0_][0x00000001] = ($a_Pfad_ & $_a_X_File_Next_)
$_0_ += 0x00000001
Until False
FileClose($_a_X_File_)
EndIf
Dim $a_Verzeichnis_ = _FileListToArray($a_Pfad_, $_a_Tren_[0x00000001], 0x00000002)
For $_i_ = 0x00000001 To UBound($a_Verzeichnis_) - 0x00000001
If (_File_Link_($a_Pfad_ & $a_Verzeichnis_[$_i_]) = True) Then ContinueLoop
_Show_Dubell_(String($a_Pfad_ & $a_Verzeichnis_[$_i_] & $_a_Tren_[0x00000002]), $a_Wildcards_)
Next
EndFunc ;==>_Show_Dubell_
Func _Dubell_List_($_a_C_ArraySave_, $_0_)
For $_i_ = 0x00000000 To $_0_ - 0x00000001
$_a_S_Save_ = $_a_Tren_[0x00000000]
For $_e_ = $_i_ To $_0_ - 0x00000001
If ($_a_C_ArraySave_[$_e_][0x00000000] <> $_a_C_ArraySave_[$_i_][0x00000000]) Then ExitLoop
$_a_S_Save_ &= ($_a_C_ArraySave_[$_e_][0x00000001] & $_a_Tren_[0x00000003])
Next
If ($_e_ - $_i_ < 0x00000002) Then ContinueLoop
$_a_B_ArraySave_[$_1_][0x00000000] = ($_a_C_ArraySave_[$_i_][0x00000000])
$_a_B_ArraySave_[$_1_][0x00000001] = (StringTrimRight($_a_S_Save_, 0x00000001))
$_i_ += ($_e_ - $_i_ - 0x00000001)
$_1_ += 0x00000001
Next
EndFunc ;==>_Dubell_List_
Func _File_Link_($_sF_Link_)
Dim $_a_K_32_ = DllOpen('kernel32.dll')
Dim $_D_Array_ = DllCall($_a_K_32_, 'dword', 'GetFileAttributesW', 'wstr', $_sF_Link_)
If (@error) Then Return SetError(0x00000000, @error, 0x00000000)
Return BitAND($_D_Array_[0x00000000], 0x00000400) = 0x00000400
EndFunc ;==>_File_Link_
_Files_list_Rekursiv_Hash_Dubell
;#RequireAdmin
#include-once
#include <Array.au3>
#include <Crypt.au3>
#include <File.au3>
;==============================================================================================================================#
;~ Function Name....: _File_List_Hash_Dubell()
;
;~ Description......: Auflistung von Dateien
;
;~ $_a_Pfad_........: Pfad
;~ $_Set_Runde_.....: '1' ( Standart ) wie oft die Funktion aufgerufen wird ( beispiel C:\ & D:\ durchsuchen auf 2 setzen )
;~ $a_Wildcards_....: '*' ( Standart ) Suchbegrif u. o. Wildcards
;
;~ Return Value(s)..: Array ( Standard ) mit den gefundenen Dateien Array[0] endhält die anzahl ( Fund )
;
;~ Author(s)........: Kleiner27 (http://www.autoit.de) # 27.03.2010 09:00 #
;==============================================================================================================================#
Local $_U_
Local $Runde_
Local $_a_Hash
Local $_a_S_Save_
Local $_a_X_File_
Local $_a_X_File_Next_
Local $_0_ = 0x00000000
Local $_1_ = 0x00000000
Local $_a_A_ArraySave_[0x000F423F][0x0000003]
Local $_a_B_ArraySave_[0x000F423F][0x0000002]
Local $_a_Tren_[0x00000004] = [Chr(0x00000020), Chr(0x0000002A), Chr(0x0000005C), Chr(0x0000007C)]
Dim $iTimer = TimerInit()
Dim $F = _File_List_Hash_Dubell('D:', 0, '*')
_ArrayDisplay($F, TimerDiff($iTimer))
Func _File_List_Hash_Dubell($a_Pfad_, $_Set_Runde_ = True, $a_Wildcards_ = True)
If (StringRight($a_Pfad_, 0x00000001) <> $_a_Tren_[0x00000002]) Then $a_Pfad_ = ($a_Pfad_ & $_a_Tren_[0x00000002])
If ($_Set_Runde_ = $_a_Tren_[0x00000000] Or $_Set_Runde_ = 0x00000000) Then $_Set_Runde_ = (0x00000001)
If ($a_Wildcards_ = $_a_Tren_[0x00000000]) Then $a_Wildcards_ = ($_a_Tren_[1])
If ($_U_ < $Runde_) Then
ReDim $_a_B_ArraySave_[0x000F423F][0x00000002]
ReDim $_a_A_ArraySave_[0x000F423F][0x00000003]
EndIf
$_U_ += 0x00000001
_Crypt_Startup()
_Show_Dubell_Hash_($a_Pfad_, $a_Wildcards_)
_Crypt_Shutdown()
If ($_0_ = 0x00000000) Then Return SetError(0x00000002, 0x00000000, $_a_Tren_[0x00000000])
$Runde_ = ($_U_)
Switch ($Runde_)
Case ($_Set_Runde_)
ReDim $_a_A_ArraySave_[$_0_][0x00000003]
_ArraySort($_a_A_ArraySave_, 0x00000000, 0x00000000, 0x00000000, 0x00000000)
_Hash_Dubell_List_($_a_A_ArraySave_, $_0_)
If ($_1_ = 0x00000000) Then Return SetError(0x00000002, 0x00000000, $_a_Tren_[0x00000000])
ReDim $_a_B_ArraySave_[$_1_][0x00000002]
$_0_ = 0x00000000
$_1_ = 0x00000000
Return ($_a_B_ArraySave_)
EndSwitch
Return ($_a_B_ArraySave_)
EndFunc ;==>_File_List_Hash_Dubell
Func _Show_Dubell_Hash_($a_Pfad_, $a_Wildcards_)
$_a_X_File_ = FileFindFirstFile($a_Pfad_ & $a_Wildcards_)
If ($_a_X_File_ <> -0x00000001) Then
Do
$_a_X_File_Next_ = FileFindNextFile($_a_X_File_)
If (@error) Then ExitLoop
If (@extended = 0x00000001) Then ContinueLoop
$_a_Hash = String(_Crypt_HashFile($a_Pfad_ & $_a_X_File_Next_, 0x00008003))
If ($_a_Hash <> 0x00000000) Then ContinueLoop
$_a_A_ArraySave_[$_0_][0x00000000] = ($_a_Hash)
$_a_A_ArraySave_[$_0_][0x00000001] = ($_a_X_File_Next_)
$_a_A_ArraySave_[$_0_][0x00000002] = ($a_Pfad_ & $_a_X_File_Next_)
$_0_ += 0x00000001
Until False
FileClose($_a_X_File_)
EndIf
Dim $a_Verzeichnis_ = _FileListToArray($a_Pfad_, $_a_Tren_[0x00000001], 0x00000002)
For $_i_ = 0x00000001 To UBound($a_Verzeichnis_) - 0x00000001
If (_File_Link_($a_Pfad_ & $a_Verzeichnis_[$_i_]) = True) Then ContinueLoop
_Show_Dubell_Hash_(String($a_Pfad_ & $a_Verzeichnis_[$_i_] & $_a_Tren_[0x00000002]), $a_Wildcards_)
Next
EndFunc ;==>_Show_Dubell_Hash_
Func _Hash_Dubell_List_($_a_C_ArraySave_, $_0_)
For $_i_ = 0x00000000 To $_0_ - 0x00000001
$_a_S_Save_ = $_a_Tren_[0x00000000]
For $_e_ = $_i_ To $_0_ - 0x00000001
If ($_a_C_ArraySave_[$_e_][0x00000000] <> $_a_C_ArraySave_[$_i_][0x00000000]) Then ExitLoop
$_a_S_Save_ &= ($_a_C_ArraySave_[$_e_][0x00000002] & $_a_Tren_[0x00000003])
Next
If ($_e_ - $_i_ < 0x00000002) Then ContinueLoop
$_a_B_ArraySave_[$_1_][0x00000000] = ($_a_C_ArraySave_[$_i_][0x00000001])
$_a_B_ArraySave_[$_1_][0x00000001] = (StringTrimRight($_a_S_Save_, 0x00000001))
$_i_ += ($_e_ - $_i_ - 0x00000001)
$_1_ += 0x00000001
Next
EndFunc ;==>_Hash_Dubell_List_
Func _File_Link_($_sF_Link_)
Dim $_a_K_32_ = DllOpen('kernel32.dll')
Dim $_D_Array_ = DllCall($_a_K_32_, 'dword', 'GetFileAttributesW', 'wstr', $_sF_Link_)
If (@error) Then Return SetError(0x00000000, @error, 0x00000000)
Return BitAND($_D_Array_[0x00000000], 0x00000400) = 0x00000400
EndFunc ;==>_File_Link_
_Reg_Rekursiv
;#RequireAdmin
#include-once
#include <Array.au3>
;===================================================================================================================================================#
;~ Function Name....: _Reg_List_Rekursiv()
;
;~ Description......: Auflistung von RegPfad
;
;~ $_a_Pfad_........: RegPfad
;~ $_Set_Runde_.....: '1' ( Standart ) wie oft die Funktion aufgerufen wird ( beispiel HKEY_USERS & HKEY_CURRENT_USER durchsuchen auf 2 setzen )
;
;~ Return Value(s)..: Array ( Standard ) mit den gefundenen RegPfad Array[0] endhält die anzahl ( Fund )
;
;~ Author(s)........: Kleiner27 (http://www.autoit.de) # 27.03.2010 09:00 #
;===================================================================================================================================================#
Local $_U_
Local $Runde_
Local $RegPaht_Next_
Local $_a_Zaehlen_ = 0x00000001
Local $Reg_Paht_Save_[0x000F423F]
Local $_a_Tren_[0x00000002] = [Chr(0x00000020), Chr(0x0000005C)]
Dim $iTimer = TimerInit()
Dim $F = _Reg_List_Rekursiv('HKEY_CURRENT_USER', 0)
_ArrayDisplay($F, TimerDiff($iTimer))
Func _Reg_List_Rekursiv($RegPaht, $_Set_Runde_ = True)
If ($_Set_Runde_ = $_a_Tren_[0x00000000] Or $_Set_Runde_ = 0x00000000) Then $_Set_Runde_ = (0x00000001)
If ($_U_ < $Runde_) Then
ReDim $Reg_Paht_Save_[0x000F423F]
EndIf
$_U_ += 0x00000001
_Show_Reg_Rekursiv($RegPaht)
$Runde_ = ($_U_)
Switch ($Runde_)
Case ($_Set_Runde_)
ReDim $Reg_Paht_Save_[$_a_Zaehlen_]
$Reg_Paht_Save_[0x00000000] = ($_a_Zaehlen_)
$_a_Zaehlen_ = 0x00000001
Return ($Reg_Paht_Save_)
EndSwitch
Return ($Reg_Paht_Save_)
EndFunc ;==>_Reg_List_Rekursiv
Func _Show_Reg_Rekursiv($RegPaht)
For $i = 0x00000001 To 0x000F423F
$RegPaht_Next_ = RegEnumKey($RegPaht, $i)
If @error <> 0x00000000 Then ExitLoop
$Reg_Paht_Save_[$_a_Zaehlen_] = ($RegPaht & $_a_Tren_[0x00000001] & $RegPaht_Next_)
$_a_Zaehlen_ += 0x00000001
_Show_Reg_Rekursiv($RegPaht & $_a_Tren_[0x00000001] & $RegPaht_Next_)
Next
EndFunc ;==>_Show_Reg_Rekursiv
Viel Spass!
LG Kleiner
AspirinJunkie
Ich meine Md5-Berechnung denn du hast ja schon saubere arbeit geleistet!
Versuche meine arbeit weiter zu entwickeln denn wo ich mir dein Code angeschaut habe hätte ich mir in den Ars..... beißen könne denn ich habe eine Func geschrieben die Rekursiv die Verzeichnise auflistet und da habe ich auch schon FileFindFirstFile verwendet , gleich eingebunden und noch ein paar änderungen schon 50% schneller gut gegen deine Func seh ich alt aus
aber z.B 3200 Datein zu vergleichen bin ich 1 sec. langsamer also um so größer die Datei anzahl um so langsamer bin ich gegen deine Func z.b 81 000 Datein [Deine zwischen 19 - 22 sec.] und [Meine zwischen 30-35 sec.]
Ich habe im gefühl da geht noch was! ![]()
Die 50% Schnellere Version Post#1
LG Kleiner
JuraX
Auch richtig gut gemacht von Oscar find ich richtig klasse kannte ich noch nicht !
AspirinJunkie
Schöne idee, da geht noch einiges an tempo rauszuholen! ![]()
Eine GUI Version in Post#1
LG Kleiner
Das Tool ist richtig gut!
Mal sehen was mit AutoIT möglich ist ertmal ging es mir um die Geschwindigkeit die ersten Versionen sind 30 min gelaufen!
LG Kleiner
Dublette
Bedeutung : Von Wikipedia
Dublette (veraltet Doublette) (Lehnwort aus dem 18. Jahrhundert nach frz. doublet, zu double = doppelt) bezeichnet:
autoBert
Eine andere Version mit Pfad ausgabe!
Nur leider benötigt zum Vergleich um bis zu 10 sec. länger !
Bei mir Drive Windows 81 600 und 2446 Dubletten 68 sec. ohne Pfad ausgabe 56 sec.
edit: jetzt ausgabe mit leerZeilen vorher 2446 jetzt 91 817 Array einträge in 70 sec.
LG Kleiner
Hi AutoBert!
Werde ich mit rein nehmen!
Ist dann auch einfacher als den Pfad selber zu schreiben o. kopieren!
Habe gerade noch ein Dubletten finder gepostet den werde ich auch mit rein nehmen!
LG Kleiner
Hi Leute!
Fals einer gebrauchen kann habe ein Dubletten finden geschreiben!
Fund bie 100% überinstimmung von Dateinamen!
Ausgabe: Name der Datei und wie oft gefunden in 2D_Array!
Func:
#include-once
#include <File.au3>
#include <Array.au3>
Local $a_Tren[4] = ['', '*', '\', '|'], $a_Save[1], $b_Save[1][2], $d_Save, $a_Ende, $a_Split, $z_0, $z_1, $z_2
[/autoit] [autoit][/autoit] [autoit]$iTimer = TimerInit()
$F = _List_Folder_Dubel('D:\')
_ArrayDisplay($F, TimerDiff($iTimer))
Func _List_Folder_Dubel($a_Pfad)
If StringRight($a_Pfad, 1) <> $a_Tren[2] Then $a_Pfad = $a_Pfad & $a_Tren[2]
ReDim $b_Save[999999][2]
ReDim $a_Save[999999]
$z_0 = 0
$z_2 = 0
_Show_Dubel($a_Pfad)
ReDim $a_Save[$z_0]
_ArraySort($a_Save)
_Dubel_Finder($a_Save)
ReDim $b_Save[$z_2][2]
Return ($b_Save)
EndFunc ;==>_List_Folder_Dubel
Func _Show_Dubel($a_Pfad)
Dim $a_D = _FileListToArray($a_Pfad, $a_Tren[1], 1)
For $i = 1 To UBound($a_D) - 1
$a_Save[$z_0] = $a_D[$i]
$z_0 += 1
Next
Dim $a_V = _FileListToArray($a_Pfad, $a_Tren[1], 2)
For $i = 1 To UBound($a_V) - 1
_Show_Dubel($a_Pfad & $a_V[$i] & $a_Tren[2])
Next
EndFunc ;==>_Show_Dubel
Func _Dubel_Finder($c_Save)
$a_Ende = UBound($c_Save) - 1
For $i = 0 To $a_Ende Step +1
;ConsoleWrite($i & ' ' & $a_Ende & ' ' & $c_Save[$i] & @CRLF)
If ($c_Save[$i] = $a_Tren[0]) Then ContinueLoop
$z_1 = 0
$d_Save = $a_Tren[0]
For $j = $i To $a_Ende Step +1
If (StringLeft($c_Save[$j], 5) <> StringLeft($c_Save[$i], 5) Or StringRight($c_Save[$j], 5) <> StringRight($c_Save[$i], 5)) Then ExitLoop
If ($c_Save[$j] <> $c_Save[$i]) Then ContinueLoop
$z_1 += 1
$d_Save &= ($j & $a_Tren[3])
Next
If ($z_1 > 1) Then
$b_Save[$z_2][0] = $c_Save[$i]
$b_Save[$z_2][1] = $z_1
$z_2 += 1
$a_Split = StringSplit($d_Save, $a_Tren[3])
For $e = 1 To UBound($a_Split) - 1
$c_Save[$a_Split[$e]] = $a_Tren[0]
Next
EndIf
Next
EndFunc ;==>_Dubel_Finder
Beispiel Func: Mit Pfad ausgabe
#include-once
#include <File.au3>
#include <Array.au3>
Local $a_Tren[4] = ['', '*', '\', '|'], $a_Save[1][2], $b_Save[1][2], $a_Ende, $a_Zsave, $a_Split, $z_0, $z_1, $z_2
[/autoit] [autoit][/autoit] [autoit]$iTimer = TimerInit()
$F = _List_Folder_Dubel('D:\')
_ArrayDisplay($F, TimerDiff($iTimer))
Func _List_Folder_Dubel($a_Pfad)
If StringRight($a_Pfad, 1) <> $a_Tren[2] Then $a_Pfad = $a_Pfad & $a_Tren[2]
ReDim $b_Save[999999][2]
ReDim $a_Save[999999][2]
$z_0 = 0
$z_2 = 0
_Show_Dubel($a_Pfad)
ReDim $a_Save[$z_0][2]
_ArraySort($a_Save)
_Dubel_Finder($a_Save)
ReDim $b_Save[$z_2][2]
Return ($b_Save)
EndFunc ;==>_List_Folder_Dubel
Func _Show_Dubel($a_Pfad)
Dim $a_D = _FileListToArray($a_Pfad, $a_Tren[1], 1)
For $i = 1 To UBound($a_D) - 1
$a_Save[$z_0][0] = $a_D[$i]
$a_Save[$z_0][1] = $a_Pfad & $a_D[$i]
$z_0 += 1
Next
Dim $a_V = _FileListToArray($a_Pfad, $a_Tren[1], 2)
For $i = 1 To UBound($a_V) - 1
_Show_Dubel($a_Pfad & $a_V[$i] & $a_Tren[2])
Next
EndFunc ;==>_Show_Dubel
Func _Dubel_Finder($c_Save)
$a_Ende = UBound($c_Save) - 1
For $i = 0 To $a_Ende Step +1
;ConsoleWrite($i & ' ' & $a_Ende & ' ' & $c_Save[$i] & @CRLF)
If ($c_Save[$i][0] = $a_Tren[0]) Then ContinueLoop
$z_1 = 0
$d_Save = $a_Tren[0]
$a_Zsave = $a_Tren[0]
For $j = $i To $a_Ende Step +1
If (StringLeft($c_Save[$j][0], 5) <> StringLeft($c_Save[$i][0], 5) Or StringRight($c_Save[$j][0], 5) <> StringRight($c_Save[$i][0], 5)) Then ExitLoop
If ($c_Save[$j][0] <> $c_Save[$i][0]) Then ContinueLoop
$z_1 += 1
$d_Save &= ($j & $a_Tren[3])
$a_Zsave &= ($c_Save[$j][1] & $a_Tren[3]); man könnte das Array auch hir füllen
Next
If ($z_1 > 1) Then
$b_Save[$z_2][0] = $c_Save[$i][0]
$b_Save[$z_2][1] = $z_1
$a_Split = StringSplit($a_Zsave, $a_Tren[3])
$z_2 += 1 ; <---- Kann gelöscht werden ################################################## beispiel zum trennen der Ansicht!
For $s = 1 To UBound($a_Split) - 1
;$z_2 += 1 ;<------------------------------ Aktivieren
$b_Save[$z_2][0] = $a_Split[$s]
$z_2 += 1; <------------------------------ Löschen
Next
$a_Split = StringSplit($d_Save, $a_Tren[3])
For $e = 1 To UBound($a_Split) - 1
$c_Save[$a_Split[$e]][0] = $a_Tren[0]
Next
EndIf
Next
EndFunc ;==>_Dubel_Finder
Beispiel: Mit GUI
#include <Array.au3>
#include <File.au3>
#include <GuiListView.au3>
#include <ListViewConstants.au3>
#include <GUIConstantsEx.au3>
#include <StructureConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Global $a_Tren[4] = ['', '*', '\', '|'], $a_Save[1][2], $b_Save[1][2], $a_Psave[1], $a_Ende, $a_Zsave, $a_Split, $a_NewSave, $z_0, $z_1, $z_2, $z_3, $a_W, $a_W1, $F, $a_La, $a_SU
Global $Form, $a_PE, $a_PP, $hLVH, $hLVH1, $prog, $za = 0.2
$Form = GUICreate('Dubletten - Find - List', 670, 388, -1, -1)
GUISetOnEvent(-3, '_Exit')
$a_PE = GUICtrlCreateListView('', 8, 80, 250, 300)
_GUICtrlListView_AddColumn($a_PE, 'Datei/Name', 166, 0)
_GUICtrlListView_AddColumn($a_PE, 'Fund/Anzahl', 80, 1)
_GUICtrlListView_SetExtendedListViewStyle($a_PE, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_ONECLICKACTIVATE, $LVS_EX_DOUBLEBUFFER))
$hLVH = GUICtrlGetHandle($a_PE)
$a_PP = GUICtrlCreateListView('', 260, 80, 402, 300)
_GUICtrlListView_AddColumn($a_PP, 'Datei/Pfad', 500, 0)
_GUICtrlListView_SetExtendedListViewStyle($a_PP, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_ONECLICKACTIVATE, $LVS_EX_DOUBLEBUFFER))
$hLVH1 = GUICtrlGetHandle($a_PP)
GUICtrlCreateButton('Suche Starten', 560, 15, 100, 50)
GUICtrlSetOnEvent(-1, '_SDL')
$prog = GUICtrlCreateProgress(8, 28, 544, 25)
GUISetState()
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
[/autoit] [autoit][/autoit] [autoit]Func _SDL()
;GUISetState(@SW_DISABLE, $Form)
$F = _List_Folder_Dubel(FileSelectFolder('Bitte Zielverzeichnis auswählen', @DesktopDir, 2, '', $Form))
ToolTip('Bitte warten...', Default, Default, 'Liste wird erstellt!', 1, 3)
$a_W = $F[0]
_GUICtrlListView_DeleteAllItems($hLVH)
Sleep(100)
If IsArray($a_W) Then
_GUICtrlListView_BeginUpdate($a_PE)
_GUICtrlListView_AddArray($hLVH, $a_W)
_GUICtrlListView_EndUpdate($a_PE)
EndIf
_GUICtrlListView_SetColumnWidth($hLVH, 0, $LVSCW_AUTOSIZE_USEHEADER)
_GUICtrlListView_SetColumnWidth($hLVH, 1, $LVSCW_AUTOSIZE_USEHEADER)
ToolTip('')
;GUISetState(@SW_ENABLE, $Form)
EndFunc ;==>_SDL
Func _PAl()
GUISetState(@SW_DISABLE, $Form)
$a_W1 = $F[1]
$a_NewSave = ''
$a_La = _GUICtrlListView_GetItemText($a_PE, _GUICtrlListView_GetHotItem($a_PE))
If IsArray($a_W1) Then
For $i = 0 To UBound($a_W1) - 1
$a_Split = StringSplit($a_W1[$i], $a_Tren[2])
$a_SU = $a_Split[UBound($a_Split) - 1]
If (StringLeft($a_SU, 5) <> StringLeft($a_La, 5) Or StringRight($a_SU, 5) <> StringRight($a_La, 5)) Then ContinueLoop
If ($a_SU = $a_La) Then $a_NewSave &= $a_W1[$i] & $a_Tren[3]
Next
EndIf
If ($a_NewSave = '') Then Return
$a_Split = StringSplit($a_NewSave, $a_Tren[3])
If IsArray($a_Split) Then
_GUICtrlListView_BeginUpdate($hLVH1)
For $i = 1 To UBound($a_Split) - 1
GUICtrlCreateListViewItem($a_Split[$i], $a_PP)
Next
_GUICtrlListView_SetColumnWidth($hLVH1, 0, $LVSCW_AUTOSIZE_USEHEADER)
_GUICtrlListView_EndUpdate($hLVH1)
EndIf
GUISetState(@SW_ENABLE, $Form)
EndFunc ;==>_PAl
Func _List_Folder_Dubel($a_Pfad)
ToolTip('Benachrichtigung bei Aktionen' & @CRLF & 'Bitte warten...', Default, Default, 'Daten werden Eingelesen', 1, 3)
;GUISetState(@SW_HIDE, $Form)
If StringRight($a_Pfad, 1) <> $a_Tren[2] Then $a_Pfad = $a_Pfad & $a_Tren[2]
ReDim $b_Save[999999][2]
ReDim $a_Save[999999][2]
ReDim $a_Psave[999999]
$z_0 = 0
$z_2 = 0
$z_3 = 0
_Show_Dubel($a_Pfad)
ReDim $a_Save[$z_0][2]
_ArraySort($a_Save)
ToolTip('')
ToolTip('Bitte warten...', Default, Default, 'Prüfung gestartet!', 1)
_Dubel_Finder($a_Save)
ReDim $b_Save[$z_2][2]
ReDim $a_Psave[$z_3]
Dim $a_Dubbel_Save[2] = [$b_Save, $a_Psave]
;GUISetState(@SW_SHOW, $Form)
ToolTip('')
Return ($a_Dubbel_Save)
EndFunc ;==>_List_Folder_Dubel
Func _Show_Dubel($a_Pfad)
Dim $a_D = _FileListToArray($a_Pfad, $a_Tren[1], 1);$a_Tren[1]
For $i = 1 To UBound($a_D) - 1
$a_Save[$z_0][0] = $a_D[$i]
$a_Save[$z_0][1] = $a_Pfad & $a_D[$i]
$z_0 += 1
Next
Dim $a_V = _FileListToArray($a_Pfad, $a_Tren[1], 2)
For $i = 1 To UBound($a_V) - 1
_Show_Dubel($a_Pfad & $a_V[$i] & $a_Tren[2])
Next
EndFunc ;==>_Show_Dubel
Func _Dubel_Finder($c_Save)
$a_Ende = UBound($c_Save) - 1
For $i = 0 To $a_Ende Step +1
;ConsoleWrite($i & ' ' & $a_Ende & ' ' & $c_Save[$i] & @CRLF)
If ($c_Save[$i][0] = $a_Tren[0]) Then ContinueLoop
$z_1 = 0
$d_Save = $a_Tren[0]
$a_Zsave = $a_Tren[0]
For $j = $i To $a_Ende Step +1
If (StringLeft($c_Save[$j][0], 5) <> StringLeft($c_Save[$i][0], 5) Or StringRight($c_Save[$j][0], 5) <> StringRight($c_Save[$i][0], 5)) Then ExitLoop
If ($c_Save[$j][0] <> $c_Save[$i][0]) Then ContinueLoop
$z_1 += 1
$d_Save &= ($j & $a_Tren[3])
$a_Zsave &= ($c_Save[$j][1] & $a_Tren[3])
Next
GUICtrlSetData($prog, $i * 100 / $a_Ende)
If ($z_1 > 1) Then
$b_Save[$z_2][0] = $c_Save[$i][0]
$b_Save[$z_2][1] = $z_1
$z_2 += 1
$a_Split = StringSplit($a_Zsave, $a_Tren[3])
For $s = 1 To UBound($a_Split) - 1
$a_Psave[$z_3] = $a_Split[$s]
$z_3 += 1
Next
$a_Split = StringSplit($d_Save, $a_Tren[3])
For $e = 1 To UBound($a_Split) - 1
$c_Save[$a_Split[$e]][0] = $a_Tren[0]
Next
EndIf
Next
EndFunc ;==>_Dubel_Finder
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
$hWndListView = $hLVH
If Not IsHWnd($hLVH) Then $hWndListView = GUICtrlGetHandle($hLVH)
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, 'hWndFrom'))
$iIDFrom = DllStructGetData($tNMHDR, 'IDFrom')
$iCode = DllStructGetData($tNMHDR, 'Code')
Switch $hWndFrom
Case $hWndListView
Switch $iCode
Case $NM_CLICK
$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
ToolTip('Liste wird erstellt Bitte warten...', Default, Default, 'Speicher wird abgefragt!', 1, 3)
_GUICtrlListView_DeleteAllItems($a_PP)
_PAl()
ToolTip('')
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
Func _Exit()
Exit
EndFunc ;==>_Exit
While 1 * Sleep(10)
WEnd
Überarbeitete Version: um 50% Schneller
#include-once
#include <File.au3>
#include <Array.au3>
Local $a_Tren[4] = ['', '*', '\', '|'], $a_Save[1][2], $b_Save[1][2], $d_Save, $a_Ende, $a_Split, $c_Save, $z_0, $z_1, $z_2
Local $a_D, $a_D1, $a_Pfad
$iTimer = TimerInit()
$F = _List_Folder_Dubel('C:')
_ArrayDisplay($F, TimerDiff($iTimer))
Func _List_Folder_Dubel($a_Pfad)
If (StringRight($a_Pfad, 1) <> $a_Tren[2]) Then $a_Pfad = ($a_Pfad & $a_Tren[2])
ReDim $b_Save[999999][2]
ReDim $a_Save[999999][2]
$z_0 = 0
$z_2 = 0
_Show_Dubel($a_Pfad)
ReDim $a_Save[$z_0][2]
_ArraySort($a_Save)
_Dubel_Finder($a_Save)
ReDim $b_Save[$z_2][2]
Return ($b_Save)
EndFunc ;==>_List_Folder_Dubel
Func _Show_Dubel($a_Pfad)
$a_D = FileFindFirstFile($a_Pfad & '*')
If $a_D <> -1 Then
Do
$a_D1 = FileFindNextFile($a_D)
If @error Then ExitLoop
If @extended Then ContinueLoop
$a_Save[$z_0][0] = $a_D1
$a_Save[$z_0][1] = ($a_Pfad & $a_D1)
$z_0 += 1
Until 0
FileClose($a_D)
EndIf
Dim $a_V = _FileListToArray($a_Pfad, $a_Tren[1], 2)
For $i = 1 To UBound($a_V) - 1
_Show_Dubel($a_Pfad & $a_V[$i] & $a_Tren[2])
Next
EndFunc ;==>_Show_Dubel
Func _Dubel_Finder($c_Save)
$a_Ende = UBound($c_Save) - 1
For $i = 0 To $a_Ende
$z_1 = 0
$d_Save = $a_Tren[0]
For $j = $i To $a_Ende
If ($c_Save[$j][0] <> $c_Save[$i][0]) Then ExitLoop
$z_1 += 1
$d_Save &= ($c_Save[$j][1] & $a_Tren[3])
Next
If ($z_1 < 2) Then ContinueLoop
$b_Save[$z_2][0] = $c_Save[$i][0]
$b_Save[$z_2][1] = $d_Save
$z_2 += 1
$i += ($z_1 - 1)
Next
EndFunc ;==>_Dubel_Finder
LG Kleiner
Hi Leute!
Hatte vor einiger Zeit ein kleines Backup Programm Geschrieben, Jetzt habe ich den Code ein wenig überarbeitet und stell ihn euch vor.
Alt: Alle Dateien wurden Kopiert und erstellt.
Neu: 1.) Dateien werden nicht mehr „Kopiert“, Naja eigentlich schon sie werden ausgelesen und neu Geschrieben.
Sollte beim Schreiben eine Datei Existieren wird sie nicht erstellt sowie Leere Verzeichnisse, das kann schon mal Verwirrung stiften bei erneuter Prüfung, hat den Sinn das ich keine Leere Verzeichnisse Benötige. ![]()
Neu: 2.) Backup Prüfung „bei gleichen Namen vom Verzeichnis‘‘ .
Die Überprüfung findet auf eine Auslese Basis mit Hash wert Erstellung + Vergleich stad.
Die Prüfung Findet in drei Stufen stad 1. Existiert die Datei wenn ja weiter mit Punkt 2. Größer – Kleiner der zu Prüfende Datei wenn Gleich wird die Datei Binär Ausgelesen gewandelt in ein Hash Code und wird dann auf gleich ungleich geprüft.
Ist nur ein Zeichen anders o. ein Leerzeichen wurde hinzugefügt ist die Datei nicht mehr gleich dem Gegenstück und kann neu Erstellt werden.
Die Geschwindigkeit ist für mich Akzeptabel.
#NoTrayIcon
#RequireAdmin
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=G:\Bilder\SAMMLUNG\Icon_S\Refresh.ico
#AutoIt3Wrapper_UseX64=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
;#include <_ArrayMultiDisplay.au3>
#include <GuiListView.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt('GUIOnEventMode', 1)
Global $Form[2]
Local $F
Local $UB
Local $FN
Local $RAS
Local $Verz
Local $Expan
Local $aDaten, $Stopp = 0
Local $ListView[2], $hListView[2]
Local $Progress[2], $Label[10], $Button[6], $Input[2], $Einstellung, $Kontroll
$Form[0] = GUICreate('BackUp - Erstellen/Prüfen ', 400, 300, -1, -1)
GUISetOnEvent(-3, 'GUI_Exit')
GUICtrlCreateGroup('', 10, 85, 375, 50)
$Label[0] = GUICtrlCreateLabel('Quelle', 12, 10, 52, 20)
GUICtrlSetFont(-1, 8, 0, '', 'Calibri')
$Input[0] = GUICtrlCreateInput('', 10, 25, 200, 20)
GUICtrlSetFont(-1, 8, 0, '', 'Calibri')
$Button[0] = GUICtrlCreateButton('...', 213, 24.5, 30, 20)
GUICtrlSetOnEvent(-1, 'Menue')
$Label[1] = GUICtrlCreateLabel('BackUp Prüfen / Ziel', 12, 50, 80, 20)
GUICtrlSetFont(-1, 8, 0, '', 'Calibri')
$Input[1] = GUICtrlCreateInput('', 10, 65, 200, 20)
GUICtrlSetFont(-1, 8, 0, '', 'Calibri')
$Button[1] = GUICtrlCreateButton('...', 213, 64.5, 30, 20)
GUICtrlSetOnEvent(-1, 'Menue')
$Button[2] = GUICtrlCreateButton('Start...', 260, 24.5, 60, 20)
GUICtrlSetOnEvent(-1, 'Menue')
$Button[3] = GUICtrlCreateButton('Stopp...', 325, 24.5, 60, 20)
$Einstellung = GUICtrlCreateCombo('Backup Erstellen', 260, 64.5, 125, 20, $CBS_DROPDOWNLIST)
GUICtrlSetData($Einstellung, 'Backup Prüfen')
$ListView[0] = GUICtrlCreateListView('', 0, 140, 400, 150, BitOR((0x0004 + 0x8000), 0x00010000))
$hListView[0] = GUICtrlGetHandle($ListView[0])
GUICtrlSetFont(-1, 7.5, 0, '', 'Calibri')
_GUICtrlListView_InsertColumn($hListView[0], 0, 'Daten', 55)
_GUICtrlListView_InsertColumn($hListView[0], 1, 'Erstellt', 50)
_GUICtrlListView_InsertColumn($hListView[0], 2, 'Verändert', 50)
_GUICtrlListView_InsertColumn($hListView[0], 3, 'Letzter zu Griff', 50)
_GUICtrlListView_InsertColumn($hListView[0], 4, 'Größe', 50)
_GUICtrlListView_InsertColumn($hListView[0], 5, 'Attribute', 40)
_GUICtrlListView_InsertColumn($hListView[0], 6, 'Version', 50)
_GUICtrlListView_InsertColumn($hListView[0], 7, 'Status', 50)
$Progress[0] = GUICtrlCreateProgress(0, 290, 400, 10)
$Progress[1] = GUICtrlCreateProgress(20, 105, 50, 15)
$Label[2] = GUICtrlCreateLabel('', 80, 102, 300, 25)
GUICtrlSetFont(-1, 14, 800, '', 'Calibri')
GUISetState()
$Form[1] = GUICreate('Bericht...', 200, 250, -1, -1)
GUISetOnEvent(-3, 'Form_HIDE')
GUICtrlCreateGroup('', 10, 30, 180, 80)
$Label[3] = GUICtrlCreateLabel('Details der Prüfung...', 40, 10, 120, 20)
GUICtrlSetFont(-1, 10, 800, '', 'Calibri')
$Label[4] = GUICtrlCreateLabel('', 25, 50, 120, 20)
GUICtrlSetFont(-1, 8.5, 700, '', 'Calibri')
$Label[5] = GUICtrlCreateLabel('', 25, 80, 160, 20)
GUICtrlSetFont(-1, 8.5, 700, '', 'Calibri')
$Button[4] = GUICtrlCreateButton('Erstellen', 21, 118, 80, 19)
GUICtrlSetOnEvent(-1, 'Menue')
$Button[5] = GUICtrlCreateButton('OK', 100, 118, 80, 19)
GUICtrlSetOnEvent(-1, 'Form_HIDE')
$ListView[1] = GUICtrlCreateListView('', 12, 140, 175, 100, BitOR((0x0004 + 0x8000), 0x00010000))
$hListView[1] = GUICtrlGetHandle($ListView[1])
GUICtrlSetFont(-1, 7.5, 0, '', 'Calibri')
_GUICtrlListView_InsertColumn($hListView[1], 0, 'Daten', 55)
_GUICtrlListView_InsertColumn($hListView[1], 1, 'Erstellt', 50)
_GUICtrlListView_InsertColumn($hListView[1], 2, 'Verändert', 50)
_GUICtrlListView_InsertColumn($hListView[1], 3, 'Letzter zu Griff', 50)
_GUICtrlListView_InsertColumn($hListView[1], 4, 'Größe', 50)
_GUICtrlListView_InsertColumn($hListView[1], 5, 'Attribute', 40)
_GUICtrlListView_InsertColumn($hListView[1], 6, 'Version', 50)
_GUICtrlListView_InsertColumn($hListView[1], 7, 'Status', 50)
GUISetState(@SW_HIDE)
GUIRegisterMsg($WM_COMMAND, 'MY_WM_COMMAND')
[/autoit] [autoit][/autoit] [autoit]Func Menue()
Switch @GUI_CtrlId
Case $Button[0]
ControlSetText($Form[0], '', $Input[0], FileSelectFolder('Bitte Quellverzeichnis auswählen', @DesktopDir, 2, '', $Form[0]))
Case $Button[1]
ControlSetText($Form[0], '', $Input[1], FileSelectFolder('Bitte Quellverzeichnis auswählen', @DesktopDir, 2, '', $Form[0]))
Case $Button[2]
_GUICtrlListView_DeleteAllItems($hListView[0])
If GUICtrlRead($Input[0]) And GUICtrlRead($Input[1]) Then Daten(GUICtrlRead($Input[0]), GUICtrlRead($Input[1]), GUICtrlRead($Einstellung))
Case $Button[4]
Local $UeberW = GetListViewToArray(1)
Local $sQuelle, $F_opUe, $F_opUe2, $SizeUe, $FileUe, $ByteUe, $O_DriveUe, $O_Drive_vUe, $DriveUe, $iVerzeichnisUe, $iPahtAnpassungUe
If IsArray($UeberW) And GUICtrlRead($Input[0]) And GUICtrlRead($Input[1]) Then
ProgressOn('Datein Schreiben...', 'Datein werden Neu Geschreiben!', '')
If O_Drive(GUICtrlRead($Input[0])) <> O_Drive(GUICtrlRead($Input[1])) Then $iPahtAnpassungUe = 1
$DriveUe = GetDrive(GUICtrlRead($Input[1]))
$O_Drive_vUe = O_Drive(GUICtrlRead($Input[1]))
$O_DriveUe = O_Drive(GUICtrlRead($Input[0]))
For $i = 1 To $UeberW[0][0]
$sQuelle = GetFileInfo($UeberW[$i][0])
If $iPahtAnpassungUe Then
If (StringLen(GUICtrlRead($Input[0])) > StringLen(GUICtrlRead($Input[1]))) Then
$iVerzeichnisUe = StringMid($sQuelle[0], StringInStr(GUICtrlRead($Input[0]), '\', 0, -1) + 1, StringLen($sQuelle[0]))
Else
$iVerzeichnisUe = StringLeft($O_Drive_vUe, StringInStr($O_Drive_vUe, $O_DriveUe) - 1) & O_Drive($sQuelle[0])
EndIf
Else
$iVerzeichnisUe = O_Drive($sQuelle[0])
EndIf
$SizeUe = StringReplace(StringReplace(StringLeft($sQuelle[10], StringLen($sQuelle[10]) - 8), ' ', ''), '-1', '0')
$FileUe = GetFileName($sQuelle[0], 1)
If FileExists($DriveUe & $iVerzeichnisUe) Then FileDelete($DriveUe & $iVerzeichnisUe)
$F_opUe = FileOpen($sQuelle[0], 16)
If $F_opUe = -1 And ProgressSet(Round($i * 100 / $UeberW[0][0]), Round($i * 100 / $UeberW[0][0]) & ' % Fehler ( beim Öffnen )') Then ContinueLoop
$F_opUe2 = FileOpen($DriveUe & $iVerzeichnisUe, 26)
If $F_opUe2 = -1 And ProgressSet(Round($i * 100 / $UeberW[0][0]), Round($i * 100 / $UeberW[0][0]) & ' % Fehler ( beim Öffnen )') Then ContinueLoop
If (Round(($SizeUe / 1048576)) > 25) Then
$SizeUe = Int($SizeUe / 99)
Do
$ByteUe = FileRead($F_opUe, $SizeUe)
If @error Then ExitLoop
FileWrite($F_opUe2, $ByteUe)
Until False
Else
FileWrite($F_opUe2, FileRead($F_opUe))
EndIf
FileClose($F_opUe)
FileClose($F_opUe2)
ProgressSet(Round($i * 100 / $UeberW[0][0]), Round($i * 100 / $UeberW[0][0]) & ' % ' & $i & ' von ' & $UeberW[0][0] & ' ' & $FileUe)
Next
EndIf
Sleep(3000)
ProgressOff()
EndSwitch
EndFunc ;==>Menue
Func Daten(Const $Quelle, Const $BackUp, Const $iV_W)
If Not StringCompare($Quelle, $BackUp) Then Return MsgBox(0x40000 + 0x20 + 0x1000, 'Bericht', ' Quelle u. Ziel sind Gleich ' & @CRLF & ' Vorgang wurde Abgebrochen!', 10)
If Not FileExists($Quelle) Then Return MsgBox(0x40000 + 0x20 + 0x1000, 'Bericht', ' Quelle Existiert nicht ' & @CRLF & ' Vorgang wurde Abgebrochen!', 10)
Local $aGetDat, $iVerzeichnis, $iPahtAnpassung = 0, $O_Drive, $O_Drive_v, $Byte, $Byte_v
Local $Size, $Size_v, $M5, $sM5, $M5_v, $sM5_v, $F_op, $F_op2, $F_G, $F_Gv, $Counter, $File
If O_Drive($Quelle) <> O_Drive($BackUp) Then $iPahtAnpassung = 1
ToolTip(' Lese Vorgang... ', Default, Default, ' Daten werden Eingelesen Bitte warten... ', 1, 2)
$aDaten = _FileListToRekursiv($Quelle)
ToolTip('')
Local $iDrive = GetDrive($BackUp)
$O_Drive_v = O_Drive($BackUp)
$O_Drive = O_Drive($Quelle)
$Stopp = 0
If Not IsArray($aDaten) Then Return
If ($iV_W = 'Backup Prüfen') Then
For $i = 1 To $aDaten[0]
If $Stopp Then Return
If $iPahtAnpassung Then
If (StringLen($Quelle) > StringLen($BackUp)) Then
$iVerzeichnis = StringMid($aDaten[$i], StringInStr($Quelle, '\', 0, -1) + 1, StringLen($aDaten[$i]))
Else
$iVerzeichnis = StringLeft($O_Drive_v, StringInStr($O_Drive_v, $O_Drive) - 1) & O_Drive($aDaten[$i])
EndIf
Else
$iVerzeichnis = O_Drive($aDaten[$i])
EndIf
WinSetTitle($Form[0], '', $i & ' von ' & $aDaten[0])
GUICtrlSetData($Progress[0], ($i * 100) / $aDaten[0])
$aGetDat = GetFileInfo($aDaten[$i])
GUICtrlSetData($Progress[1], 0)
If Not StringInStr($iVerzeichnis, $O_Drive_v) Then Return MsgBox(0x40000 + 0x10 + 0x1000, 'Bericht', ' Das Verzeichniss Existirt nicht ' & @CRLF & ' Prüfung wurde Abgebrochen!', 10)
If Not FileExists($iDrive & $iVerzeichnis) Then
If Set_ListView(0, $aGetDat) Then ContinueLoop
Else
$aGetDat_v = GetFileInfo($iDrive & $iVerzeichnis)
Switch GetDFF($aDaten[$i])
Case 'Files'
$F_G = StringReplace(StringLeft($aGetDat[10], StringLen($aGetDat[10]) - 8), ' ', '')
$F_Gv = StringReplace(StringLeft($aGetDat_v[10], StringLen($aGetDat_v[10]) - 8), ' ', '')
If ($F_G <> $F_Gv) Then
If Set_ListView(0, $aGetDat) Then ContinueLoop
Else
If ($F_G = -1 And $F_Gv = -1) Then ContinueLoop
$File = GetFileName($aGetDat[0], 1)
If (StringLen($File) > 24) Then $File = StringLeft($File, StringLen($File) - 3) & '...'
GUICtrlSetData($Label[2], $File)
$F_op = FileOpen($aGetDat[0], 16)
If $F_op = -1 Then ContinueLoop
$F_op2 = FileOpen($aGetDat_v[0], 16)
If $F_op2 = -1 Then ContinueLoop
If (Round(($F_G / 1048576)) > 25) Then
$Size = Int($F_G / 99)
$Size_v = Int($F_Gv / 99)
$Counter = 0
Do
$Byte = FileRead($F_op, $Size)
$Byte_v = FileRead($F_op2, $Size_v)
If @error Then ExitLoop
$Counter += 1
$M5 = Crypt($Byte)
$M5_v = Crypt($Byte_v)
$sM5 &= StringRight($M5, StringLen($M5) - 2)
$sM5_v &= StringRight($M5_v, StringLen($M5_v) - 2)
GUICtrlSetData($Progress[1], $Counter)
Until False
If (Crypt($sM5) <> Crypt($sM5_v)) Then Set_ListView(0, $aGetDat_v)
Else
If (Crypt(FileRead($F_op)) <> Crypt(FileRead($F_op2))) Then Set_ListView(0, $aGetDat_v)
GUICtrlSetData($Progress[1], 100)
EndIf
FileClose($F_op)
FileClose($F_op2)
EndIf
EndSwitch
EndIf
Next
WinSetTitle($Form[0], '', 'BackUp - Erstellen/Prüfen ')
$Kontroll = GetListViewToArray(0)
If Not IsArray($Kontroll) Then Return MsgBox(0x40000 + 0x40 + 0x1000, 'Bericht', ' Die Prüfung ist abgeschlossen ' & @CRLF & 'Beide Daten Blöcke sind Identisch!', 10)
_GUICtrlListView_DeleteAllItems($hListView[1])
Local $GMG = 0
For $i = 1 To $Kontroll[0][0]
$GMG += StringReplace(StringLeft($Kontroll[$i][1], StringLen($Kontroll[$i][1]) - 8), ' ', '')
Set_ListView(1, GetFileInfo($Kontroll[$i][0]))
Progress_ListView(1, GetDFF($Kontroll[$i][0]))
Next
GUICtrlSetData($Label[4], 'Anzahl der Datein: ' & $Kontroll[0][0])
GUICtrlSetData($Label[5], 'Größe der Datein: ' & Round(($GMG / 1048576)) & ' MByte(s)')
GUISetState(@SW_SHOW)
Else
For $i = 1 To $aDaten[0]
If $Stopp Then Return
Set_ListView(0, GetFileInfo($aDaten[$i]))
If $iPahtAnpassung Then
If (StringLen($Quelle) > StringLen($BackUp)) Then
If Not StringInStr($O_Drive, $O_Drive_v) Then
$iVerzeichnis = $O_Drive_v & '\' & O_Drive($aDaten[$i])
Else
$iVerzeichnis = StringMid($aDaten[$i], StringInStr($Quelle, '\', 0, -1) + 1, StringLen($aDaten[$i]))
EndIf
Else
$iVerzeichnis = $O_Drive_v & '\' & O_Drive($aDaten[$i])
EndIf
EndIf
WinSetTitle($Form[0], '', $i & ' von ' & $aDaten[0])
GUICtrlSetData($Progress[0], ($i * 100) / $aDaten[0])
$aGetDat = GetFileInfo($aDaten[$i])
GUICtrlSetData($Progress[1], 0)
If FileExists($iDrive & $iVerzeichnis) And Progress_ListView(0, 'Existiert') Then ContinueLoop
Switch GetDFF($aDaten[$i])
Case 'Folder'
If Progress_ListView(0, 'Folder') Then ContinueLoop
Case 'Files'
$Size_v = StringReplace(StringReplace(StringLeft($aGetDat[10], StringLen($aGetDat[10]) - 8), ' ', ''), '-1', '0')
$File = GetFileName($aGetDat[0], 1)
If (StringLen($File) > 24) Then $File = StringLeft($File, StringLen($File) - 3) & '...'
GUICtrlSetData($Label[2], $File)
$F_op = FileOpen($aGetDat[0], 16)
If $F_op = -1 And Progress_ListView(0, 'Fehler ( beim Öffnen )') Then ContinueLoop
$F_op2 = FileOpen($iDrive & $iVerzeichnis, 26)
If $F_op2 = -1 And Progress_ListView(0, 'Fehler ( beim Öffnen )') Then ContinueLoop
$Counter = 0
If (Round(($Size_v / 1048576)) > 25) Then
$Size = Int($Size_v / 99)
Do
$Byte = FileRead($F_op, $Size)
If @error Then ExitLoop
$Counter += $Size
FileWrite($F_op2, $Byte)
GUICtrlSetData($Progress[1], Round($Counter * 100 / $Size_v))
Progress_ListView(0, Round($Counter * 100 / $Size_v, -1) & ' %')
Until False
Else
FileWrite($F_op2, FileRead($F_op))
GUICtrlSetData($Progress[1], 100)
Progress_ListView(0, '100 %')
EndIf
FileClose($F_op)
FileClose($F_op2)
EndSwitch
Next
If FileExists($iDrive & $O_Drive) Then ShellExecute($iDrive & $O_Drive)
EndIf
WinSetTitle($Form[0], '', 'BackUp - Erstellen/Prüfen ')
EndFunc ;==>Daten
Func Set_ListView($iIndex, $aDat)
Local $sIndex = _GUICtrlListView_GetItemCount($hListView[$iIndex])
_GUICtrlListView_AddItem($hListView[$iIndex], $aDat[0], $sIndex)
_GUICtrlListView_AddSubItem($hListView[$iIndex], $sIndex, $aDat[7], 1)
_GUICtrlListView_AddSubItem($hListView[$iIndex], $sIndex, $aDat[8], 2)
_GUICtrlListView_AddSubItem($hListView[$iIndex], $sIndex, $aDat[9], 3)
_GUICtrlListView_AddSubItem($hListView[$iIndex], $sIndex, StringReplace($aDat[10], '-1', '0'), 4)
_GUICtrlListView_AddSubItem($hListView[$iIndex], $sIndex, $aDat[11], 5)
_GUICtrlListView_AddSubItem($hListView[$iIndex], $sIndex, $aDat[12], 6)
Return _GUICtrlListView_EnsureVisible($hListView[$iIndex], $sIndex)
EndFunc ;==>Set_ListView
Func Progress_ListView($iIndex, $aDat)
Local $sIndex = _GUICtrlListView_GetItemCount($hListView[$iIndex])
Return _GUICtrlListView_SetItemText($hListView[$iIndex], $sIndex - 1, $aDat, 7)
EndFunc ;==>Progress_ListView
Func GetListViewToArray($iIndex)
Local $UB = _GUICtrlListView_GetItemCount($hListView[$iIndex])
If Not $UB Then Return False
Local $GCount[$UB + 1][2]
$GCount[0][0] = $UB
For $i = 1 To $GCount[0][0]
$GCount[$i][0] = _GUICtrlListView_GetItemText($hListView[$iIndex], ($i - 1))
$GCount[$i][1] = _GUICtrlListView_GetItemText($hListView[$iIndex], ($i - 1), 4)
Next
Return $GCount
EndFunc ;==>GetListViewToArray
;===================================================================================================================================#
;~ Function Name....: _FileListToRekursiv($Pfad, $Wildc = '*', $Flag = 0)
;
;~ Description......: Auflistung von Dateien
;
;~ $_Pfad_..........: Pfad
;~ $Wildc_..........: '*' ( Standart ) Suchbegrif u. o. Wildcards bei Wildcards mit o. suchbegriff $_Flag_ auf '3' setzen es ist auch
; möglich mehrere suchbegriffe zu suchen z.B ( *wma,*mp3,*txt ) o. ( wma,mp3,txt ) getrennt mit ','
;~ $Flag............: '0' ( Standart ) Datein u. Ordner '1' nur Datein '2' nur Ordner '3' um mit suchbegriffen zu suchen wie (*.txt)
;
;~ Return Value(s)..: Array ( Standard ) mit den gefundenen Dateien u. o Ordner Array[0] endhält die anzahl ( Fund )
;
;~ Author(s)........: Kleiner (http://www.autoit.de) # 27.03.2010 09:00 #
;====================================================================================================================================#
Func _FileListToRekursiv($Pfad, Const $Wildc = '*', Const $Flag = 0)
$Pfad = StringRegExpReplace($Pfad, '[\\/]+\z', '\') & '\'
If Not FileExists($Pfad) Then Return SetError(1, 1, '')
If StringRegExp($Wildc, '[\\/:><\|]|(?s)\A\s*\z') Then Return SetError(2, 2, '')
If Not ($Flag = 0 Or $Flag = 1 Or $Flag = 2 Or $Flag = 3) Then Return SetError(3, 3, '')
If ($RAS <> '') Then $RAS = ''
Rekursiv($Pfad, StringReplace(StringReplace($Wildc, '*', ''), ',', '|'), $Flag)
If Not $RAS Then Return SetError(4, 4, '')
Return StringSplit(StringTrimLeft($RAS, 1), '|')
EndFunc ;==>_FileListToRekursiv
Func Rekursiv($Pfad, $Wildc, $Flag)
Local $FL
$F = FileFindFirstFile($Pfad & '*')
If ($F <> -1) Then
While True
$FN = FileFindNextFile($F)
If @error Then ExitLoop
$Expan = @extended
Switch $Flag
Case 0
Switch $Expan
Case 0
$RAS &= '|' & $Pfad & $FN
Case 1
$FL &= '|' & $FN & '\'
$RAS &= '|' & $Pfad & $FN
EndSwitch
Case 1
Switch $Expan
Case 0
$RAS &= '|' & $Pfad & $FN
Case 1
$FL &= '|' & $FN & '\'
EndSwitch
Case 2
If $Expan Then
$FL &= '|' & $FN & '\'
$RAS &= '|' & $Pfad & $FN
EndIf
Case 3
If $Expan Then $FL &= '|' & $FN & '\'
If Not $Expan Then
If StringRegExp($FN, $Wildc) Then $RAS &= '|' & $Pfad & $FN
EndIf
EndSwitch
WEnd
EndIf
FileClose($F)
If Not $FL Then Return $FL = '|'
$Verz = StringSplit(StringTrimLeft($FL, 1), '|')
$UB = UBound($Verz) - 1
For $i = 0 To $UB - 1
$Verz[$i] = $Verz[$i + 1]
Next
ReDim $Verz[$UB]
For $For In $Verz
If Not GetFileAttributes($Pfad & $For) Then Rekursiv($Pfad & $For, $Wildc, $Flag)
Next
EndFunc ;==>Rekursiv
Func GetFileAttributes($FLS);[user='200143']progandy[/user]
Dim Static $K32 = DllOpen('kernel32.dll')
Dim $DA = DllCall($K32, 'dword', 'GetFileAttributesW', 'wstr', $FLS)
If (@error) Then Return SetError(1, @error, False)
Return BitAND($DA[0], 1024) = 1024
EndFunc ;==>GetFileAttributes
Func GetFileInfo($sPath, $iSize = 0, $Extension = 0)
If Not FileExists($sPath) Then Return SetError(1, 0, -1)
Local $FileInfo = '|' & $sPath; Original
$FileInfo &= '|' & FileGetLongName($sPath); LongName
$FileInfo &= '|' & FileGetShortName($sPath); ShortName
$FileInfo &= '|' & GetDrive($sPath); Drive
$FileInfo &= '|' & GetVerzeichnis($sPath); Verzeichnis
$FileInfo &= '|' & GetFileName($sPath, $Extension); Dateiname
$FileInfo &= '|' & GetExtensionName($sPath); Datei erweiterung
$FileInfo &= '|' & StringRegExpReplace(FileGetTime($sPath, 1, 1), '(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})', '$3.$2.$1 $4:$5:$6'); Erstellt
$FileInfo &= '|' & StringRegExpReplace(FileGetTime($sPath, 0, 1), '(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})', '$3.$2.$1 $4:$5:$6'); Verändert
$FileInfo &= '|' & StringRegExpReplace(FileGetTime($sPath, 2, 1), '(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})', '$3.$2.$1 $4:$5:$6'); Letzter Zugrif
$FileInfo &= '|' & FileGetSize_BKGMT($sPath, $iSize) ; Größe
$FileInfo &= '|' & FileGetAttrib($sPath); Attribute
$FileInfo &= '|' & FileGetVersion($sPath); Version
Return StringSplit(StringTrimLeft($FileInfo, 1), '|', 2)
EndFunc ;==>GetFileInfo
Func FileGetSize_BKGMT($sPath, $iSize = 0)
If Not FileExists($sPath) Then Return SetError(1, 0, -1)
If ($iSize < 0) Or ($iSize > 4) Then $iSize = 0
Local $Error
Local $aSize[5] = [' Byte(s)', ' KByte(s)', ' MByte(s)', ' GByte(s)', ' TByte(s)']
$eSize = Round(FileGetSize($sPath) / 1024 ^ $iSize, 2)
If Not $eSize Then $eSize = Round(DirGetSize($sPath) / 1024 ^ $iSize, 2)
Return $eSize & $aSize[$iSize]
EndFunc ;==>FileGetSize_BKGMT
Func GetFileName($sPath, $Extension = 0)
If Not $Extension Then
Dim $GFN = StringMid($sPath, StringInStr($sPath, '\', 0, -1) + 1, StringLen($sPath))
Return StringLeft($GFN, StringInStr($GFN, '.') - 1)
Else
Return StringMid($sPath, StringInStr($sPath, '\', 0, -1) + 1, StringLen($sPath))
EndIf
EndFunc ;==>GetFileName
Func GetDFF($Drive_Folder_Files); Is Folder or Files or Drive
Local $objExist = ObjCreate('Scripting.FileSystemObject')
If @error Then Return SetError(1, 1, -1)
If $objExist.DriveExists($Drive_Folder_Files) Then Return 'Drive'
If $objExist.FolderExists($Drive_Folder_Files) Then Return 'Folder'
If $objExist.FileExists($Drive_Folder_Files) Then Return 'Files'
Return 0
EndFunc ;==>GetDFF
Func GetDrive($sPath)
Return StringLeft($sPath, StringInStr($sPath, '\'))
EndFunc ;==>GetDrive
Func GetVerzeichnis($sPath)
Return StringMid($sPath, StringInStr($sPath, '\'), StringInStr($sPath, '\', 0, -1) - 2)
EndFunc ;==>GetVerzeichnis
Func GetExtensionName($sPath)
Return StringMid($sPath, StringInStr($sPath, '.', 0, -1), StringLen($sPath))
EndFunc ;==>GetExtensionName
Func O_Drive($sPath)
Return StringRight($sPath, StringLen($sPath) - StringLen(StringLeft($sPath, StringInStr($sPath, '\'))))
EndFunc ;==>O_Drive
Func Crypt($sData)
Dim Static $DLL32 = DllOpen('advapi32.dll')
Local $Ret, $hProv, $hHash, $tData
$hProv = DllCall($DLL32, 'int', 'CryptAcquireContextW', 'ptr*', 0, 'ptr', 0, 'ptr', 0, 'dword', 3, 'dword', 0xF0000000)
If (@error) Or (Not $hProv[0]) Then Return ''
$hHash = DllCall($DLL32, 'int', 'CryptCreateHash', 'ptr', $hProv[1], 'uint', 0x00008003, 'ptr', 0, 'dword', 0, 'ptr*', 0)
If (@error) Or (Not $hHash[0]) Then Return ''
$hHash = $hHash[5]
$tData = DllStructCreate('byte[' & BinaryLen($sData) & ']')
DllStructSetData($tData, 1, $sData)
$Ret = DllCall($DLL32, 'int', 'CryptHashData', 'ptr', $hHash, 'ptr', DllStructGetPtr($tData), 'dword', DllStructGetSize($tData), 'dword', 1)
If (@error) Or (Not $Ret[0]) Then Return ''
$tData = DllStructCreate('byte[16]')
$Ret = DllCall($DLL32, 'int', 'CryptGetHashParam', 'ptr', $hHash, 'dword', 2, 'ptr', DllStructGetPtr($tData), 'dword*', 16, 'dword', 0)
If (@error) Or (Not $Ret[0]) Then Return ''
If $hHash Then DllCall($DLL32, 'int', 'CryptDestroyHash', 'ptr', $hHash)
Return DllStructGetData($tData, 1)
EndFunc ;==>Crypt
Func MY_WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
;ConsoleWrite(BitShift($wParam, 16) & ' ' & BitAND($wParam, 0xFFFF) & ' ' & GUICtrlRead(BitAND($wParam, 0xFFFF), 1) & @CR)
$wParam = BitAND($wParam, 0xFFFF)
If (IsArray($aDaten) And $wParam = $Button[3]) Then $Stopp = 1
Return $GUI_RUNDEFMSG
EndFunc ;==>MY_WM_COMMAND
Func Form_HIDE()
GUISetState(@SW_HIDE, @GUI_WinHandle)
EndFunc ;==>Form_HIDE
Func GUI_Exit()
Exit
EndFunc ;==>GUI_Exit
While True * Sleep(10)
WEnd
Lg Kleiner
Lustig ist das alle datein die kompiliert nicht gehen auch nicht die .au3 nixht mal nach einem neustart aber ertellt man eine neue .au3 mit dem selben inhalt kann man den zweig wieder auslesen!
LG Kleiner