Single Procedure Download - WeOnlyDo Discussion board

Single Procedure Download (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Stephen Bourne, Friday, December 09, 2005, 01:09 (6739 days ago)

I'd like to know if I can have a more clean approach to downloading the contents of a remote directory. I want to, within one procedure, initiate the connection, find the list of files names, download all of them, and close the connection. The disjoint process of responding to events doesn't really work with the code that I am writing. Is this possible?

Re: Single Procedure Download

by wodSupport, Friday, December 09, 2005, 01:14 (6739 days ago) @ Stephen Bourne

Stephen,

if you use blocking mode then you can Connect, call ListDir and then check value of ListItem property. Would that help? No need to use events.

Re: Single Procedure Download

by Stephen Bourne, Friday, December 09, 2005, 01:17 (6739 days ago) @ wodSupport

Sounds great. How do I set the blocking mode? What if the list of files is very long? How will I know when the listitem property is complete?

Stephen,

if you use blocking mode then you can Connect, call ListDir and then check value of ListItem property. Would that help? No need to use events.

Re: Single Procedure Download

by wodSupport, Friday, December 09, 2005, 01:19 (6739 days ago) @ Stephen Bourne

Set Blocking property to True. No matter how large list is, ListDir will not return until it's completed.