Best method to apply filter to retrieve certain fi - WeOnlyDo Discussion board

Best method to apply filter to retrieve certain fi (General questions)

by kevino, Wednesday, July 02, 2008, 18:20 (5991 days ago)

I have a large folder tree containing hundreds of folders and thousands of files. I need to get about 1/4 of the files in that tree and do not want to simply grab them all and filter them out on the recieving end. The problem is that these are log files which continually get added on the server 24x7. My connection speed to the server is slow enough that it makes grabbing them all not feasable.

Using the SFTP activeX control, it seems like I should get a listing of all files found and then apply a filter in my application to get a shorter list to pursue retrieving using GetFiles. Is that the best i can do? I read GetFiles will not perform best when having to invoke it over and over for each file, rather then letting it retrieve files in batch.

thoughts?

Re: Best method to apply filter to retrieve certai

by woddrazen, Wednesday, July 02, 2008, 20:52 (5991 days ago) @ kevino

Hi Kevino,


When GetFiles Method is issue LoopItem Event fired for each file. You can then in LoopItem Event decide what you want to do with file (download it or skip it).

More help for LoopItem Event here:
http://www.weonlydo.com/SFTP/Help/wodSFTPLib~wodSFTP~LoopItem_EV.html

Can you please try it and let us know how it goes.

Hope I helped.


Regards,
Drazen

Re: Best method to apply filter to retrieve certai

by kevino, Wednesday, July 02, 2008, 21:59 (5991 days ago) @ woddrazen

Hi Kevino,


When GetFiles Method is issue LoopItem Event fired for each file. You can then in LoopItem Event decide what you want to do with file (download it or skip it).

More help for LoopItem Event here:
http://www.weonlydo.com/SFTP/Help/wodSFTPLib~wodSFTP~LoopItem_EV.html

Can you please try it and let us know how it goes.

Hope I helped.


Regards,
Drazen

Thanks... on a related note... trying to determine whether a directory exists... why doesn't realpath raise the looperror event?

Re: Best method to apply filter to retrieve certai

by woddrazen, Wednesday, July 02, 2008, 22:03 (5991 days ago) @ kevino

Kevino,


Done Event will be fired with error 30018 if folder doesn't exist.


Drazen