A substitute 'FileCopy'
i'd imagine this has been done before, but if it has i haven't seen it. all it is is a substitute for the FileCopy statement. copies a file byte-for-byte to a new destination. 110% commented just like 'A+ Secure Delete' And 'A "Dummy" File Generator' (both by me). well hope you like this.
Original Author: Im_[B]0ReD
Code
Function CopyFile(srcFile As String, dstFile As String)
'this copies a file byte-for-byte
'or you could just use good old FileCopy :-)
On Error Resume Next 'If we get an error, keep going
Dim Copy As Long, CopyByteForByte As Byte 'the variables
Open srcFile For Binary Access Write As #1 'open the destination file so we can write to it
Open dstFile For Binary Access Read As #2 'open the source file so we can read from it
For Copy = 1 To LOF(2) 'Copy The SourceFile Byte-For-Byte
Put #1, , CopyByteForByte 'Put the byte in the destination file
Next Copy 'stop the loop
MsgBox "Done!"
End Function
Loading Comments ...
Comments
No comments have been added for this post.
You must be logged in to make a comment.