GetFiles then DeleteFile processing (General questions)
I am trying to download a directory of files and then delete them. I want to use the event driven method so if a file files I can carry on.
This is what I am doing.
Display Start
Connetct to FTP
Display Connected
Display GetFiles
GetFiles
Display Done
LoopItemEvent
Display Downloading
Output is
Start
Connected
GetFiles
Done
Downloading (repeat per file)
So if execution does not halt at getfiles how do I do the delete process when the GetFiles process does not pause execution.
How do I pause execution?
Re: GetFiles then DeleteFile processing
Hi Ogedei,
The Done event will be triggered when GetFiles is executed. That's when you should invoke DeleteFiles method.
I'm not sure what you mean by *pause*. You can only Abort the method, using Abort method, which will stop the method that is currently executing.
Or, perhaps I misunderstood something? If so, please let me know.
regards,
Damba
Re: GetFiles then DeleteFile processing
So the Done Event is fired at the end of the GetFiles and not at the end of every file?
Re: GetFiles then DeleteFile processing
Ogedei,
Yes, that's correct. Same as for PutFiles and DeleteFiles.
If you need the Done event, I would suggest that you fetch directory listing, and then Download/Delete each file separately using GetFile/DeleteFile methods.
Hope I helped.
regards,
Damba