I just ran into a problem using the copyfile api. I was trying to copy a file from one server to another using the copyfile api and it kept failing to copy the file. I couldn't figure out why it was failing. After about thirty minutes of going through my code I tried to manually copy the file and got an error stating there wasn't enough disc space. Is there a way of trapping for this or any other error that may occur while using this api?
I know that I can verify the file was copied by doing something like this:
VB Code:
dim RET as Long RET = copyfile(sourcefile, destfile,0) IF RET > 0 then msgbox "file copied" else msgbox "file not copied" END IF
But, if it fails I have no way of knowing why.


Reply With Quote