-
filecopy method
hi friends.
how to know whether a file copied using filecopy method is copied completely or not.
actually where i got the problem is i am copying a file to a temp dir and from then i am doing some operations with the copied file but as the file is not copied full i am not able to get what i want.
please help me out..
thanx
-
File copy test
You check to see if a file has been fully copied by trying to rename it. If the rename fails then the file has not fully been copied.
Try using the function below. Returns true if all ok.
Function FileRenameCheck(fileDir As String, fileNameToCheck As String) As Boolean
On Local Error GoTo errh
1000 Dim OldName As String
1001 Dim TempName As String
1002 Dim V1 As Long
1003 Dim V2 As Integer
1010 OldName = fileDir & fileNameToCheck
1020 V1 = Int((999999 * Rnd) + 1)
1030 V2 = Int((99 * Rnd) + 1)
1040 TempName = fileDir & "!" & V1 & "!." & V2 & "!"
1050 FileRenameCheck = False
1060 Name OldName As TempName
1070 Name TempName As OldName
1080 FileRenameCheck = True
1100 errh:
End Function
-
thanx cadmando(sorry i dont know ur real name) it worked very well...