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:
  1. dim RET as Long
  2.  
  3. RET = copyfile(sourcefile, destfile,0)
  4.  
  5. IF RET > 0 then
  6.     msgbox "file copied"
  7. else
  8.     msgbox "file not copied"
  9. END IF

But, if it fails I have no way of knowing why.