Hi. I have a function that fires on the creation of a file in a directory. What I want to do is make two copies of the file, copying one to one directory on a remote machine and another copy to a directory on the local machine, and then I want to delete the original. Here's a small snippet of code:
System.IO.File.Copy(myFile, destFile1)
System.IO.File.Copy(myFile, destFile2)
IO.File.Delete(myFile)
"destFile1" is on the local machine, and "destFile2" is on the remote machine. The first copying works fine. But the 2nd copying results in a file that is sometimes blank - in other words, zero bytes. Is it possible that the Delete is firing before the completion of the Copying? If so, how do I avoid this. What I'm attempting right now is changing the order of "destFile1" and "destFile2", and changing the Copy on destFile1 to a "Move". Ideas?
Thanks very much for any brave enough to help me. Happy Holidays!
Steve
System.IO.File.Copy(myFile, destFile1)
System.IO.File.Copy(myFile, destFile2)
IO.File.Delete(myFile)
"destFile1" is on the local machine, and "destFile2" is on the remote machine. The first copying works fine. But the 2nd copying results in a file that is sometimes blank - in other words, zero bytes. Is it possible that the Delete is firing before the completion of the Copying? If so, how do I avoid this. What I'm attempting right now is changing the order of "destFile1" and "destFile2", and changing the Copy on destFile1 to a "Move". Ideas?
Thanks very much for any brave enough to help me. Happy Holidays!
Steve