This function manually copies files without using any command or api through opening the source-fil
This function manually copies files without using any command or api through opening the source-file in binary mode and writing it to the
Rate This function manually copies files without using any command or api through opening the source-fil
(1(1 Vote))
Dim FileNr1 As Long
Dim FileNr2 As Long
'If file doesn't exist return nothing:
On Error Resume Next
If FileLen(SourcePath) = 0 Then Exit Function
On Error GoTo 0
'Read sourcefile
FileNr1 = FreeFile
Open SourcePath For Binary As #FileNr1
copyfile = Space$(LOF(FileNr1))
Get #FileNr1, , copyfile
Close #FileNr1
'Write destinationfile
FileNr2 = FreeFile
Open DestPath For Binary As #FileNr2
Put #FileNr2, , copyfile
Close #FileNr2
End Function
This function manually copies files without using any command or api through opening the source-fil Comments
No comments yet — be the first to post one!
Post a Comment