Académique Documents
Professionnel Documents
Culture Documents
DoEvents
fMatchRelSpec = (chkAnyLoc = 0)
fRemoveFlag = (chkKillOrphans = 1)
End If
Else
If MsgBox("Are you sure you want to copy matching files from any
location? ", vbOKCancel Or vbQuestion, _
End If
ArrowHourGlass True
sDestRoot = AddSlash(txtPaths(3))
DoEvents
cFindSrcFiles.RelativePaths = fMatchRelSpec
cFindSrcFiles.FindAllFiles sSrc1Path
DoEvents
cFindDstFiles.RelativePaths = fMatchRelSpec
cFindDstFiles.FindAllFiles sSrc2Path
DoEvents
Me.Refresh
iCompare = StrComp(cFindDstFiles.RelFileSpec(i),
cFindSrcFiles.RelFileSpec(j))
iUpTo = j ' Sorted data so skip all prev src items from next
tests
iUpTo = j ' Sorted data so skip all prev src items from next
tests
Next j
If fBackup Then
CreatePath sWorkPath
If fLog Then
x = x + 1&
aStr(x) = sWorkPath
End If
End If
Kill cFindDstFiles(i)
cFindDstFiles.RemoveFile i
rTotal = rTotal - 1!
Else
i = i + 1&
End If
On Error Resume Next ' Bug fix for no files left in folder
On Error GoTo 0
End If
Loop 'i
Me.Refresh
DoEvents
RmDir cFindDstFiles.FolderSpec(j)
End If
Next j
End If
On Error GoTo 0
End If
Me.Refresh
DoEvents
iUpTo = 0&
i = 0&
Do Until i = rTotal
If fMatchRelSpec Then
iCompare = StrComp(cFindSrcFiles.RelFileSpec(i),
cFindDstFiles.RelFileSpec(j))
Else
iCompare = StrComp(cFindSrcFiles.FileName(i),
cFindDstFiles.FileName(j))
End If
iUpTo = j ' Sorted data so skip past all prev dest items on next
tests
iCompare = CompareFileTime(cFindSrcFiles.FileLastWrite(i),
cFindDstFiles.FileLastWrite(j))
If iCompare = ftNewer Then
If fMatchRelSpec Then
CreatePath sDestPath
If fBackup Then
If FileExists(sDestPath) Then
CreatePath sWorkPath
If fLog Then
x = x + 1&
aStr(x) = sWorkPath
End If
End If
End If
If fLog Then
x = x + 1&
End If
lstResults.Visible = False
lstExists.Visible = True
On Error GoTo 0
With cFindDstFiles
lstExists.Clear
End With
With cFindSrcFiles
lstDups.Clear
If k = vbYes Then
CreatePath sDestPath
If fLog Then
x = x + 1&
aStr(x) = sDestPath
End If
End If
End If
End If
iUpTo = j ' Sorted data so skip all prev dest items from next
tests
End If
Next j
CreatePath sDestPath
If fLog Then
x = x + 1&
aStr(x) = sDestPath
End If
End If
DoEvents
End If
i = i + 1&
Loop 'i
ExitFunc:
lstExists.Visible = False
lstResults.Visible = True
lstResults.AddItem sDestRoot & Space$(i) & iCnt & " file(s) updated"
lstResults.TopIndex = lstResults.NewIndex
If x <> 0& And fLog Then
iFile = FreeFile
Close #iFile
End If
ArrowHourGlass False
UpdateJob = iCnt
Exit Function
ErrHandler:
If Err.Number = 75 Then
Resume Next
Else
End If
End Function