Sign in to follow this  
Followers 0
Metal

File Get/Set Time

6 posts in this topic

Hi.

I've a big problem with FileGetTime and FileSetTime functions.

In my script, i save in an array the times of last modification of some files, then i copy this files in another folder and set their time equal to the original ones, using the array and FileSetTime.

The problem is that the setted times for the new files is sometime wrong. Not for all the files, but some of them have a different time.

I donnow where is the problem, i only get the time from the originals -> save it in an array -> set the time on the copy. I don't manipulate them.

Can you help me please?

(the script is 651 line long, written in italian and with an horrible coding skill...don't ask to post it if you're not a masochist)

Share this post


Link to post
Share on other sites



We don't normally "create" scripts here, we help you with yours.

Try to create a small demonstration script that duplicates your problem.

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

i tryed making a smallest program to demonstrate the problem, but i failed. It seems that only my full scritp make the error happen.

here's the source:

;se c'è una cartella vuota (origine), dà errore
#include <GUIConstants.au3>
#include <EditConstants.au3>
#include <FileToArray.au3>
#include <Array.au3>
#include <GuiListBox.au3>
#include <WindowsConstants.au3>
;#include "IMAPI2.au3"
#include <GuiComboBox.au3>
#include <File.au3>

$Form1 = GUICreate("BackupIt", 530, 423, 199, 128)
$Tab1 = GUICtrlCreateTab(8, 8, 513, 385)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("Backup")
$Label1 = GUICtrlCreateLabel("Origine:", 32, 48, 40, 17)
$Input1 = GUICtrlCreateInput("", 112, 48, 193, 21, $ES_READONLY)
$Button1 = GUICtrlCreateButton("...", 320, 48, 17, 17, 0)
$Label2 = GUICtrlCreateLabel("Destinazione:", 32, 304, 68, 17)
$Input2 = GUICtrlCreateInput("", 112, 304, 193, 21, $ES_READONLY)
$Button2 = GUICtrlCreateButton("...", 320, 304, 17, 17, 0)
$Button3 = GUICtrlCreateButton("BackupIt!", 376, 344, 121, 25, 0)
$Label3 = GUICtrlCreateLabel("Stato: in attesa", 32, 344, 200, 17)
$Button4 = GUICtrlCreateButton("Aggiungi", 376, 48, 65, 25, 0)
$List1 = GUICtrlCreateList("", 32, 88, 305, 186, BitOR($LBS_SORT,$LBS_MULTIPLESEL,$WS_VSCROLL))
$Button5 = GUICtrlCreateButton("Rimuovi", 376, 112, 65, 25, 0)
$Button6 = GUICtrlCreateButton("Salva", 376, 216, 65, 25, 0)
$Button7 = GUICtrlCreateButton("Carica", 376, 248, 65, 25, 0)
$TabSheet2 = GUICtrlCreateTabItem("Masterizza")
$Label4 = GUICtrlCreateLabel("Masterizzatore da usare:", 40, 64, 119, 17)
$Combo1 = GUICtrlCreateCombo("", 184, 64, 57, 25)
$Button8 = GUICtrlCreateButton("Cancella CD/DVD", 24, 352, 105, 25, 0)
$Button9 = GUICtrlCreateButton("Masterizza!", 408, 352, 97, 25, 0)
$Label5 = GUICtrlCreateLabel("Azione in corso: in attesa", 40, 160, 200, 17)
$Label6 = GUICtrlCreateLabel("Tempo rimanente: --", 40, 184, 200, 17)
$Label7 = GUICtrlCreateLabel("Tempo trascorso: --", 40, 208, 200, 17)
$Label8 = GUICtrlCreateLabel("Tempo totale: --", 40, 232, 200, 17)
$Label9 = GUICtrlCreateLabel("Titolo:", 40, 112, 33, 17)
$Input3 = GUICtrlCreateInput("Backup", 96, 112, 153, 21)
GUICtrlCreateTabItem("")

$Menu = GUICtrlCreateMenu("File")
    $Settings = GUICtrlCreateMenuItem("Impostazioni",$Menu)
    GUICtrlCreateMenuItem("",$Menu)
    $Exit = GUICtrlCreateMenuItem("Esci",$Menu)
GUISetState(@SW_SHOW)

Global $path
Global $path1
Global $files[100000][2]
Global $dir[100000]
Global $files1[100000][2]
Global $dir1[100000]
Global $diff[100000][2];indirizzi file con data di modifica diversa
Global $new[100000][2];indirizzi sul pc dei file nuovi
Global $old[100000];indirizzi sul HD di file vecchi - non serve il tempo perché andranno cancellati
Global $split
Global $info

Global $size = 0;dimensione delle cartelle da backuppare
Global $fod;file di testo dove vengono salvati i percorsi delle directory
Global $fof;file di testo dove vengono salvati i percorsi dei file

$files[0][0] = 0
$files1[0][0] = 0
$dir[0] = 0
$dir1[0] = 0

Global $overwrite = INIRead(@ScriptDir & "\settings.ini","settings","overwrite","errore")
Global $add = INIRead(@ScriptDir & "\settings.ini","settings","add","errore")
Global $remove = INIRead(@ScriptDir & "\settings.ini","settings","remove","errore")

#cs
$ids = _IMAPI2_DrivesGetID();ID di tutti i drive
$drivestring = ''
For $i = 1 To $ids[0]
    $drive = _IMAPI2_DriveGetObj($ids[$i]);Obj del drive
    If $i = $ids[0] Then
        $drivestring = $drivestring & _IMAPI2_DriveGetLetter($drive) & ":\"
    Else
        $drivestring = $drivestring & _IMAPI2_DriveGetLetter($drive) & ":\|"
    EndIf
Next
$drive = _IMAPI2_DriveGetObj($ids[1])
GUICtrlSetData($Combo1,$drivestring,_IMAPI2_DriveGetLetter($drive)&":\")
#ce

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Exit
            Exit
        Case $Settings
            _settings()
        Case $Button1;origine
            $path = FileSelectFolder("Selezionare la cartella di origine","",1)
            If $path <> "" Then
                GUICtrlSetData($Input1,$path)
            EndIf
        Case $Button2;destinazione
            $realpath1 = FileSelectFolder("Selezionare la cartella di destinazione","",1)
            If $realpath1 <> "" Then
                GUICtrlSetData($Input2,$realpath1)
            EndIf
        Case $Button4
            If $path <> "" Then
                _GUICtrlListBox_AddString($List1,$path)
                $tempsize = DirGetSize($path)
                $size += $size
            EndIf
        Case $Button5
            $selected = _GUICtrlListBox_GetSelItems($List1)
            If $selected[0] <> 0 Then
                For $i = 1 To $selected[0]
                    _GUICtrlListBox_DeleteString($List1,$selected[$i])
                Next
            EndIf
        Case $Button6
            INIDelete(@ScriptDir & "\settings.ini", "directory")
            $itemcount = _GUICtrlListBox_GetCount($List1)
            For $i = 1 To $itemcount
                INIWrite(@ScriptDir & "\settings.ini","directory","dir"&$i,_GUICtrlListBox_GetText($List1,$i-1))
            Next
            MsgBox(64,"Salvato","I percorsi delle cartelle sono stati salvati.")
        Case $Button7
            $elements = INIReadSection(@ScriptDir & "\settings.ini", "directory")
            If Not @error Then
                $dim = UBound($elements,1) - 1
                For $i = 1 To $dim
                    _GUICtrlListBox_AddString($List1,$elements[$i][1])
                Next
            EndIf
        Case $Button3
            $itemcount = _GUICtrlListBox_GetCount($List1)
            For $i = 1 To $itemcount
                $path = _GUICtrlListBox_GetText($List1,$i-1)
            ;crea cartella nella destinazione e la setta come path1
                $newdir = StringSplit($path,"\")
                $namedir = $newdir[$newdir[0]]
                $path1 = $realpath1 & $namedir
                DirCreate($path1)
            ;origine
                If $path <> '' Then
                    GUICtrlSetData($Label3,'Stato: creazione lista origine...')
                    $sourcestate = _fileListOr()
                    If $sourcestate = 1 OR $sourcestate = 3 Then;cartella non valida o inesistente
                        MsgBox(48,"Errore","La cartella di origine:"&@CRLF&$path&@CRLF&" non è valida o è inesistente.")
                        GUICtrlSetData($Label3,'Stato: in attesa')
                        ContinueLoop
                    ElseIf $sourcestate = 2 Then;nessun file
                        MsgBox(48,"Errore","La cartella di origine:"&@CRLF&$path&@CRLF&"non contiene file.")
                        GUICtrlSetData($Label3,'Stato: in attesa')
                        ContinueLoop
                    EndIf
                    GUICtrlSetData($Label3,'Stato: in attesa')
                Else
                    MsgBox(48,"Errore","Non è stata selezionata una cartella di origine.")
                    ContinueLoop
                EndIf
            ;destinazione
                If $path1 <> '' Then
                    GUICtrlSetData($Label3,'Stato: creazione lista destinazione...')
                    $deststate = _fileListDest()
                    GUICtrlSetData($Label3,'Stato: in attesa')
                    If $deststate = 1 OR $deststate = 3 Then
                        MsgBox(48,"Errore","La cartella di destinazione:"&@CRLF&$path1&@CRLF&" non è valida o è inesistente.")
                        GUICtrlSetData($Label3,'Stato: in attesa')
                        ContinueLoop
                    ElseIf $deststate = 2 Then
                        $ask = MsgBox(4+48,"Nessun file","Nessun file trovato nella cartella di destinazione:"&@CRLF&$path1&@CRLF&"Eseguire una copia diretta?")
                        If $ask = 6 Then
                            GUICtrlSetData($Label3,'Stato: backup in corso...')
                            _directCopy()
                            GUICtrlSetData($Label3,'Stato: in attesa')
                            MsgBox(64,"Finito!","Il backup è stato eseguito con successo!")
                        Else
                            MsgBox(48,"Abortito","Backup abortito.")
                        EndIf
                    Else
                        _cutPathAddress()
                        GUICtrlSetData($Label3,'Stato: comparazione liste...')
                        _compareLists()
                        GUICtrlSetData($Label3,'Stato: in attesa')
                    ;file da aggiornare
                        If $overwrite = 0 Then
                            If $diff[0][0] <> 0 Then
                                $wtd = MsgBox(4+48,"File da aggiornare","Sono stati trovati "&$diff[0][0]&" file da aggiornare."&@CRLF&"Eseguire l'aggiornamento?")
                                If $wtd = 6 Then
                                    GUICtrlSetData($Label3,'Stato: aggiornamento file...')
                                    _updateFiles()
                                EndIf
                            EndIf
                        ElseIf $overwrite = 1 Then
                            _updateFiles()
                        EndIf
                        GUICtrlSetData($Label3,'Stato: in attesa')
                    ;file nuovi
                        If $add = 0 Then
                            If $new[0][0] <> 0 Then
                                $wtd = MsgBox(4+48,"File nuovi","Sono stati trovati "&$new[0][0]&" nuovi file."&@CRLF&"Aggiungerli al backup?")
                                If $wtd = 6 Then
                                    GUICtrlSetData($Label3,'Stato: salvataggio nuovi file...')
                                    _addFiles()
                                EndIf
                            EndIf
                        ElseIf $add = 1 Then
                            _addFiles()
                        EndIf
                        GUICtrlSetData($Label3,'Stato: in attesa')
                    ;file vecchi
                        If $remove = 0 Then
                            If $old[0] <> 0 Then
                                $wtd = MsgBox(4+48,"File vecchi","Sono stati trovati "&$old[0]&" file non più presenti nella cartella d'origine."&@CRLF&"Eliminarli?")
                                If $wtd = 6 Then
                                    GUICtrlSetData($Label3,'Stato: cancellazione file vecchi...')
                                    _deleteFiles()
                                EndIf
                            EndIf
                        ElseIf $remove = 1 Then
                            _deleteFiles()
                        EndIf
                        GUICtrlSetData($Label3,'Stato: in attesa')
                        If $diff[0][0] = 0 AND $new[0][0] = 0 AND $old[0] = 0 Then
                            MsgBox(64,"","I file presenti nella cartella di destinazione sono già aggiornati.")
                        EndIf
                        MsgBox(64,"Finito!","Il backup è stato eseguito con successo!")
                    EndIf
                Else
                    MsgBox(48,"Errore","Non è stata selezionata una cartella di destinazione.")
                    ContinueLoop
                EndIf
            Next
    EndSwitch
WEnd

Func _progress($array)
    GUICtrlSetData($Label5,"Azione in corso: " & $array[0])
    GUICtrlSetData($Label6,"Tempo rimanente: " & $array[1])
    GUICtrlSetData($Label7,"Tempo trascorso: " & $array[2])
    GUICtrlSetData($Label8,"Tempo totale: " & $array[3])
EndFunc

Func _settings()
    $1Form1 = GUICreate("Impostazioni", 318, 215, 193, 125)
    $1Label1 = GUICtrlCreateLabel("Sovrascrivi i file non aggiornati", 120, 24, 147, 17)
    $1Label2 = GUICtrlCreateLabel("Aggiungi i file nuovi", 120, 56, 95, 17)
    $1Label3 = GUICtrlCreateLabel("Elimina i file vecchi", 120, 88, 93, 17)
    $1Button1 = GUICtrlCreateButton("Applica", 16, 168, 73, 25, 0)
    $1Button2 = GUICtrlCreateButton("Chiudi", 208, 168, 73, 25, 0)
    $1Combo1 = GUICtrlCreateCombo("Chiedi", 16, 24, 89, 25)
    If $overwrite = 0 Then
        GUICtrlSetData(-1,"Sempre|Mai")
    ElseIf $overwrite = 1 Then
        GUICtrlSetData(-1,"Sempre|Mai", "Sempre")
    Else
        GUICtrlSetData(-1,"Sempre|Mai", "Mai")
    EndIf
    $1Combo2 = GUICtrlCreateCombo("Chiedi", 16, 56, 89, 25)
    If $add = 0 Then
        GUICtrlSetData(-1,"Sempre|Mai")
    ElseIf $add = 1 Then
        GUICtrlSetData(-1,"Sempre|Mai", "Sempre")
    Else
        GUICtrlSetData(-1,"Sempre|Mai", "Mai")
    EndIf
    $1Combo3 = GUICtrlCreateCombo("Chiedi", 16, 88, 89, 25)
    If $remove = 0 Then
        GUICtrlSetData(-1,"Sempre|Mai")
    ElseIf $remove = 1 Then
        GUICtrlSetData(-1,"Sempre|Mai", "Sempre")
    Else
        GUICtrlSetData(-1,"Sempre|Mai", "Mai")
    EndIf
    GUISetState(@SW_SHOW)

    While 1
        $msg = GUIGetMsg()
        Switch $msg
            Case $GUI_EVENT_CLOSE
                GuiDelete($1Form1)
                Return
            Case $1Button2
                GuiDelete($1Form1)
                Return
            Case $1Button1
                If GUICtrlRead($1Combo1) = "Chiedi" Then
                    INIWrite(@ScriptDir & '\settings.ini','settings','overwrite',0)
                ElseIf GUICtrlRead($1Combo1) = "Sempre" Then
                    INIWrite(@ScriptDir & '\settings.ini','settings','overwrite',1)
                Else
                    INIWrite(@ScriptDir & '\settings.ini','settings','overwrite',-1)
                EndIf
                
                If GUICtrlRead($1Combo2) = "Chiedi" Then
                    INIWrite(@ScriptDir & '\settings.ini','settings','add',0)
                ElseIf GUICtrlRead($1Combo2) = "Sempre" Then
                    INIWrite(@ScriptDir & '\settings.ini','settings','add',1)
                Else
                    INIWrite(@ScriptDir & '\settings.ini','settings','add',-1)
                EndIf
                
                If GUICtrlRead($1Combo3) = "Chiedi" Then
                    INIWrite(@ScriptDir & '\settings.ini','settings','remove',0)
                ElseIf GUICtrlRead($1Combo3) = "Sempre" Then
                    INIWrite(@ScriptDir & '\settings.ini','settings','remove',1)
                Else
                    INIWrite(@ScriptDir & '\settings.ini','settings','remove',-1)
                EndIf
                $overwrite = INIRead(@ScriptDir & "\settings.ini","settings","overwrite","errore")
                $add = INIRead(@ScriptDir & "\settings.ini","settings","add","errore")
                $remove = INIRead(@ScriptDir & "\settings.ini","settings","remove","errore")
        EndSwitch
    WEnd

EndFunc

Func _directCopy()
    $len = StringLen($path)
    For $i = 1 To $files[0][0]
        $files[$i][0] = StringTrimLeft($files[$i][0],$len)
    Next
    For $i = 1 To $files[0][0]
        FileCopy($path & $files[$i][0], $path1 & $files[$i][0],9)
        FileSetTime($path1 & $files[$i][0],$files[$i][1])
    Next
EndFunc

Func _deleteFiles()
    For $i = 1 To $old[0]
        FileRecycle($path1 & $old[$i])
    Next
EndFunc

Func _addFiles()
    For $i = 1 To $new[0][0]
        $a = FileCopy($path & $new[$i][0], $path1 & $new[$i][0],9)
        FileSetTime($path1 & $new[$i][0], $new[$i][1])
    Next
EndFunc

Func _updateFiles()
    For $i = 1 To $diff[0][0]
        FileCopy($path & $diff[$i][0], $path1 & $diff[$i][0],1)
        FileSetTime($path1 & $diff[$i][0], $diff[$i][1])
    Next
EndFunc

Func _cutPathAddress()
    $len = StringLen($path)
    $len1 = StringLen($path1)
    For $i = 1 To $files[0][0]
        $files[$i][0] = StringTrimLeft($files[$i][0],$len)
    Next
    For $i = 1 To $dir[0]
        $dir[$i] = StringTrimLeft($dir[$i],$len)
    Next
    
    For $i = 1 To $files1[0][0]
        $files1[$i][0] = StringTrimLeft($files1[$i][0],$len1)
    Next
    For $i = 1 To $dir1[0]
        $dir1[$i] = StringTrimLeft($dir1[$i],$len1)
    Next
EndFunc

Func _compareLists()
    $k = 0
    For $i = 1 To $files[0][0]
        For $j = 1 To $files1[0][0]
            If $files[$i][0] = $files1[$j][0] Then
                If $files[$i][1] <> $files1[$j][1] Then
                    $k = $k + 1
                    $diff[$k][0] = $files[$i][0]
                    $diff[$k][1] = $files[$i][1]
                    ExitLoop
                EndIf
            EndIf
        Next
    Next
    $diff[0][0] = $k
    
    $k = 0
    For $i = 1 To $files[0][0]
        $state = false
        For $j = 1 To $files1[0][0]
            If $files[$i][0] = $files1[$j][0] Then
                $state = true
                ExitLoop
            EndIf
        Next
        If $state = false Then
            $k = $k + 1
            $new[$k][0] = $files[$i][0]
            $new[$k][1] = $files[$i][1]
        EndIf
    Next
    $new[0][0] = $k
    
    $k = 0
    For $j = 1 To $files1[0][0]
        $state = false
        For $i = 1 To $files[0][0]
            If $files1[$j][0] = $files[$i][0] Then
                $state = true
                ExitLoop
            EndIf
        Next
        If $state = false Then
            $k = $k + 1
            $old[$k] = $files1[$j][0]
        EndIf
    Next
    $old[0] = $k
EndFunc

Func _fileListOr()
;creazione liste
    If FileExists(@ScriptDir & "\sourced.txt") Then
        FileDelete(@ScriptDir & "\sourced.txt")
    EndIf
    If FileExists(@ScriptDir & "\sourcef.txt") Then
        FileDelete(@ScriptDir & "\sourcef.txt")
    EndIf
    $filed = @ScriptDir & "\sourced.txt"
    $filef = @ScriptDir & "\sourcef.txt"
    $info = DirGetSize($path,1)
    If $info[1] = 0 AND $info[2] = 0 Then
        _deleteArray("info")
        Return 2
    EndIf
    $fod = FileOpen($filed,2)
    $fof = FileOpen($filef,2)
    $search = _SearchFolder($path)
    FileClose($fod)
    FileClose($fof)
    If $search = 1 Then;cartella non valida o inesistente [file]
        Return 1
    ElseIf $search = 3 Then;cartella non valida o inesistente [directory]
        Return 3
    EndIf
;lettura cartelle
    $read = FileRead($filed)
    $split = StringSplit($read,@LF)
    _ArrayDelete($split,$split[0])
    $split[0] -= 1
    For $i = 1 To $split[0]
        $dir[$i] = $split[$i]
    Next
    $dir[0] = $split[0]
    _deleteArray("split")
;lettura file
    $read = FileRead($filef)
    $split = StringSplit($read,@LF)
    _ArrayDelete($split,$split[0])
    $split[0] -= 1
    For $i = 1 To $split[0]
        $files[$i][0] = $split[$i]
        $files[$i][1] = FileGetTime($split[$i],0,1)
    Next
    $files[0][0] = $split[0]
    _deleteArray("split")
EndFunc

Func _fileListDest()
;creazione liste
    If FileExists(@ScriptDir & "\destd.txt") Then
        FileDelete(@ScriptDir & "\destd.txt")
    EndIf
    If FileExists(@ScriptDir & "\destf.txt") Then
        FileDelete(@ScriptDir & "\destf.txt")
    EndIf
    $filed = @ScriptDir & "\destd.txt"
    $filef = @ScriptDir & "\destf.txt"
    $info = DirGetSize($path1,1)
    If $info[1] = 0 AND $info[2] = 0 Then
        _deleteArray("info")
        Return 2
    EndIf
    $fod = FileOpen($filed,2)
    $fof = FileOpen($filef,2)
    $search = _SearchFolder($path1)
    FileClose($fod)
    FileClose($fof)
    If $search = 1 Then;cartella non valida o inesistente [file]
        Return 1
    ElseIf $search = 3 Then;cartella non valida o inesistente [directory]
        Return 3
    EndIf
;lettura cartelle
    $read = FileRead($filed)
    $split = StringSplit($read,@LF)
    _ArrayDelete($split,$split[0])
    $split[0] -= 1
    For $i = 1 To $split[0]
        $dir1[$i] = $split[$i]
    Next
    $dir[0] = $split[0]
    _deleteArray("split")
;lettura file
    $read = FileRead($filef)
    $split = StringSplit($read,@LF)
    _ArrayDelete($split,$split[0])
    $split[0] -= 1
    For $i = 1 To $split[0]
        $files1[$i][0] = $split[$i]
        $files1[$i][1] = FileGetTime($split[$i],0,1)
    Next
    $files[0][0] = $split[0]
    _deleteArray("split")
EndFunc

Func _SearchFolder($folder)
    $sFiles = _FileListToArray($folder,"*",1)
    If @error = 1 Then
        Return 1
    EndIf
    $sFolders = _FileListToArray($folder,"*",2)
    If @error = 1 Then
        Return 3
    EndIf
    _FileFunc($sFiles,$folder)
    _FolderFunc($sFolders,$folder)
EndFunc

Func _FileFunc($sFiles,$folder)
    For $i = 1 To UBound($sFiles)-1
        FileWrite($fof, $folder & "\" & $sFiles[$i] & @LF)
    Next
EndFunc

Func _FolderFunc($sFolders,$parentdir)
    For $i = 1 To UBound($sFolders)-1
        FileWrite($fod, $parentdir & "\" & $sFolders[$i] & @LF)
        _SearchFolder($parentdir & "\" & $sFolders[$i])
    Next   
EndFunc

Func _deleteArray($which)
    Switch $which
        Case "split"
            For $i = ($split[0] + 1) To 0 Step -1
                _ArrayDelete($split,$i)
            Next
        Case "info"
            For $i = 2 To 0 Step -1
                _ArrayDelete($info,$i)
            Next
    EndSwitch
EndFunc

the problem happens when function _directCopy() is used, but i can't find any logical error q.q

Share this post


Link to post
Share on other sites

I can't run it...

try this for error checking..

Func _directCopy()
    $len = StringLen($path)
    For $i = 1 To $files[0][0]
        $files[$i][0] = StringTrimLeft($files[$i][0],$len)
        ToolTip( $files[$i][0], 10, 10, "COPY INFO", 1 )
        Sleep(1000)
    Next
    For $i = 1 To $files[0][0]
        FileCopy($path & $files[$i][0], $path1 & $files[$i][0],9)
        ConsoleWrite($path & $files[$i][0] & " > " & $path1 & $files[$i][0] & @CRLF)
        FileSetTime($path1 & $files[$i][0],$files[$i][1])
        ConsoleWrite($path1 & $files[$i][0] & " > " & $files[$i][1] & @CRLF & @CRLF)
    Next
EndFunc

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Thanks for the help. Starting from where you said, and then going back through the code, i found the problem.

It was here:

Func _fileListDest()
;creazione liste
    If FileExists(@ScriptDir & "\destd.txt") Then
        FileDelete(@ScriptDir & "\destd.txt")
    EndIf
    If FileExists(@ScriptDir & "\destf.txt") Then
        FileDelete(@ScriptDir & "\destf.txt")
    EndIf
    $filed = @ScriptDir & "\destd.txt"
    $filef = @ScriptDir & "\destf.txt"
    $info = DirGetSize($path1,1)
    If $info[1] = 0 AND $info[2] = 0 Then
        _deleteArray("info")
        Return 2
    EndIf
    $fod = FileOpen($filed,2)
    $fof = FileOpen($filef,2)
    $search = _SearchFolder($path1)
    FileClose($fod)
    FileClose($fof)
    If $search = 1 Then;cartella non valida o inesistente [file]
        Return 1
    ElseIf $search = 3 Then;cartella non valida o inesistente [directory]
        Return 3
    EndIf
;lettura cartelle
    $read = FileRead($filed)
    $split = StringSplit($read,@LF)
    _ArrayDelete($split,$split[0])
    $split[0] -= 1
    For $i = 1 To $split[0]
        $dir1[$i] = $split[$i]
    Next
    $dir[0] = $split[0]
    _deleteArray("split")
;lettura file
    $read = FileRead($filef)
    $split = StringSplit($read,@LF)
    _ArrayDelete($split,$split[0])
    $split[0] -= 1
    For $i = 1 To $split[0]
        $files1[$i][0] = $split[$i]
        $files1[$i][1] = FileGetTime($split[$i],0,1)
    Next
    $files[0][0] = $split[0]
    _deleteArray("split")
EndFunc

i had to correct $files[0][0] with $files1[0][0] and $dir[0] with $dir1[0]

Thanks :D

Share this post


Link to post
Share on other sites

Great!!

Glad it helped!!

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0