1: Sub CopyFile(src As String, dst As String, TotalSize, Percent As Integer) 2: Path1$ = src 3: path2$ = dst 4: If Not FileExist(Path1$) Then PRINT "File not found: " + Path1$: GoTo 1101 5: If FileExist(path2$) Then Kill path2$ 6: total = TotalSize 7: Open Path1$ For Binary As #1 8: Open path2$ For Binary As #2 9: Per1 = Percent 10: incc = (LOF(1) / total) * 100 11: Dim ff As String * 10000 12: For Q = 1 To LOF(1) 13: Percent = ((Q / LOF(1)) * incc) + Per1 14: If Percent > lstper Then lstper = Percent 15: Get #1, , ff 16: If Q + Len(ff) > LOF(1) Then gg$ = Mid$(ff$, 1, (LOF(1) - Q) + 1): Put #2, , gg$ Else Put #2, , ff 17: Q = Q + Len(ff$) - 1 18: Next Q 19: 1101 Close 1, 2 20: End Sub |