GetFiles then DeleteFile processing - WeOnlyDo Discussion board

GetFiles then DeleteFile processing (General questions)

by Ogedei, Tuesday, June 23, 2009, 23:22 (5631 days ago)

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

by wodDamir, Tuesday, June 23, 2009, 23:36 (5631 days ago) @ Ogedei

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

by ogedei, Tuesday, June 23, 2009, 23:46 (5631 days ago) @ wodDamir

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

by wodDamir, Wednesday, June 24, 2009, 00:00 (5631 days ago) @ ogedei

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