Jump to content

Recommended Posts

Posted (edited)

k... i know im asking too much but how difficult is an updater...

i want my program to compare 2 folders (with subfolders) and if few files in folder 1 doesnt match with folder 2, it copy's them into an new folder called patch... i'm working on a project... the folder has over 10000 files and over 50 subfolder's...

Edited by Zibit
Posted

k... i know im asking too much but how difficult is an updater...

i want my program to compare 2 folders (with subfolders) and if few files in folder 1 doesnt match with folder 2, it copy's them into an new folder called patch... i'm working on a project... the folder has over 10000 files and over 50 subfolder's...

But, where is the question?

Is it that part about updater?

♡♡♡

.

eMyvnE

Posted (edited)

how can i make a program what copies all the files what dont match between folder 1 and folder 2 to another folder... sofar i figured out this:

$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)

the problem is the folders has over 50 subfolders

Edited by Zibit
Posted

k did well so long... but still something here... size's are coming in as 0

#Include <File.au3>
#Include <Array.au3>
$i = 0 ;Folder being examined
$FileListFolder = _FileListToArray(@ScriptDir & "/serv/", "*", 2) ;List Of Folders
$FileListFile = _FileListToArray(@ScriptDir & "/serv/", "*", 1) ;list of files in the folder
$dir = $FileListFolder[$i] ;chooses dir ( made for altering value 1 to list )
$search = FileFindFirstFile(@ScriptDir & $dir & "/*.*")  ;<---- u know what that is
$main = $FileListFolder[0] ;for until

FileDelete("files.tsf")
_main()
func _main()
do
    $file = FileFindNextFile($search) ;searches files
    $file_size2 = FileGetSize(@ScriptDir & $FileListFile[$i] & $file) ;size of file 2
    $file_size = FileGetSize(@ScriptDir & "/dir1/" & $file) ;size of file 1
    if $file_size <> $file_size2 then FileWriteLine("files.tsf", $file & @CRLF)
    if $file_size <> $file_size2 then FileCopy(@ScriptDir & $dir & $file, @ScriptDir & "/patch/", 1)
    if $file_size <> $file_size2 then TrayTip("", "seems ok", 0)
        MsgBox(0, "", $file_size, 0)
        MsgBox(0, "", $file_size2, 0)
        $i = $i + 1
        until $i = $main
EndFunc
FileClose($search)
  • Developers
Posted

You need to do some debugging in stead of asking here to have things figured out for you.

Use Ctrl+D on variables in SciTE and a automatic consolewrite is generate and then run your script.

You will find something is missing in those values and it probably is missing some character somewhere. :mellow:

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.
  :)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...