-
I have written some code to ftp a file from a local server and then search through my hard drive to find previous versions of the same file and then replace them.
But the search always begins well before the file has copied over.
How can I delay the file search until the ftp part of the program has finished.
I dont want to put in a time delay because the file size will gradually increase so I really need to say...ok, pause until the ftp has finished....ok, thats finished....now start to search...
Help!!!
-
I don't know your code at all, but is it the waiting procedure, it could look like this. But you need to know a way to retreive the condition that tells if the file is copied.
(Starting to copy the file)
.
.
Do
doevents
loop until (File is copied) <-- You have to set a condition
.
.
(Search the drive)
-
I have a couple of suggestions here...
1) Loop, determine if the ftp program (or task) is (still)
running - if yes, continue loop, otherwise, end loop
(you may want to see the tip
"Determining Which Tasks Are Running"
http://www.vb-world.net/api/tip147.html)
OR
2) If you called your FTP routine via "Shell",
see the tip "How do I tell when an app executed
using SHELL is finished?"
http://www.vb-world.net/api/tip5.html
hope this helps...:):):)