Zibit Posted February 10, 2010 Share Posted February 10, 2010 now im working on a project that could make rather large difference... this isnt the direct program but it does the components for it... so the problem is it always keeps replacing even if the size = size2 it shouldnt do that but it does!... take a look $search = FileFindFirstFile(@ScriptDir & "/dir1/*.*") $i = 0 FileDelete("files.tsf") ; Check if the search was successful _main() If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf func _main() while 1 $file = FileFindNextFile($search) $file_exist = FileExists(@ScriptDir & "/dir2/" & $file) $file_size = FileGetSize(@ScriptDir & "/dir1/" & $file) $file_size2 = FileGetSize($file_exist) if $file_size <> $file_size2 then FileWriteLine("files.tsf", $file & @CRLF) if $file_size <> $file_size2 then FileCopy(@ScriptDir & "/dir1/" & $file, @ScriptDir & "/patch/", 1) if $file_size <> $file_size2 then TrayTip("", "seems ok", 0) $i = $i +1 if @error then exit wend EndFunc ; Close the search handle FileClose($search) Creator Of Xtreme DevelopersPixel Pattern UDFTray GUI UDFMathssend & recive register scriptMouse Control via Webcam Link to comment Share on other sites More sharing options...
Developers Jos Posted February 10, 2010 Developers Share Posted February 10, 2010 (edited) I really really need you to STOP typing capitals only in the thread title as that is VERY annoying. Jos Edited February 10, 2010 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Developers Jos Posted February 10, 2010 Developers Share Posted February 10, 2010 What is this line supposed to do? $file_size2 = FileGetSize($file_exist) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Zibit Posted February 10, 2010 Author Share Posted February 10, 2010 get size of the file in the other dir... this works like an updater.... only it takes all the files what are different between the two folders dir1 and dir2 and copy them to another folder.... @ Capital letters sure... Creator Of Xtreme DevelopersPixel Pattern UDFTray GUI UDFMathssend & recive register scriptMouse Control via Webcam Link to comment Share on other sites More sharing options...
Developers Jos Posted February 10, 2010 Developers Share Posted February 10, 2010 get size of the file in the other dir... this works like an updater.... only it takes all the files what are different between the two folders dir1 and dir2 and copy them to another folder....Understood that but what do you think the content of the variable $file_exist is? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
stinson6016 Posted February 10, 2010 Share Posted February 10, 2010 now im working on a project that could make rather large difference... this isnt the direct program but it does the components for it... so the problem is it always keeps replacing even if the size = size2 it shouldnt do that but it does!... take a look $search = FileFindFirstFile(@ScriptDir & "/dir1/*.*") $i = 0 FileDelete("files.tsf") ; Check if the search was successful _main() If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf func _main() while 1 $file = FileFindNextFile($search) $file_exist = FileExists(@ScriptDir & "/dir2/" & $file) $file_size = FileGetSize(@ScriptDir & "/dir1/" & $file) $file_size2 = FileGetSize($file_exist) if $file_size <> $file_size2 then FileWriteLine("files.tsf", $file & @CRLF) if $file_size <> $file_size2 then FileCopy(@ScriptDir & "/dir1/" & $file, @ScriptDir & "/patch/", 1) if $file_size <> $file_size2 then TrayTip("", "seems ok", 0) $i = $i +1 if @error then exit wend EndFunc ; Close the search handle FileClose($search) $file_exist = FileExists(@ScriptDir & "/dir2/" & $file) $file_size2 = FileGetSize($file_exist) FileExists (from the help file) Return Value Success: Returns 1. Failure: Returns 0 if path/file does not exist. you are getting the file size of a 1 or 0 not the file you are looking for Gnatwork Networks Link to comment Share on other sites More sharing options...
Zibit Posted February 10, 2010 Author Share Posted February 10, 2010 (edited) ou crap.... THX u guys... u guys! u were right! correct is this... $search = FileFindFirstFile(@ScriptDir & "/test/*.*") $i = 0 FileDelete("files.tsf") ; Check if the search was successful _main() If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf func _main() while 1 $file = FileFindNextFile($search) $file_size = FileGetSize(@ScriptDir & "/test/" & $file) $file_size2 = FileGetSize(@ScriptDir & "/patch/" & $file) if $file_size <> $file_size2 then FileWriteLine("files.tsf", $file & @CRLF) if $file_size <> $file_size2 then FileCopy(@ScriptDir & "/test/" & $file, @ScriptDir & "/patch/", 1) if $file_size = $file_size2 then TrayTip("", "seems ok", 0) $i = $i +1 wend EndFunc ; Close the search handle Func _map() EndFunc FileClose($search) Edited February 10, 2010 by Zibit Creator Of Xtreme DevelopersPixel Pattern UDFTray GUI UDFMathssend & recive register scriptMouse Control via Webcam Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now