Loopfile method - WeOnlyDo Discussion board

Loopfile method (wodSFTP / wodSFTP.NET / wodSFTPdll)

by jason, Monday, December 12, 2005, 18:45 (6735 days ago)

The loopfile method looks great so far. It seems to me that one more step could make it like a remote search function. Perhaps in a future release you could think about adding a search pattern string into the method? Something like *.txt or *.* Might be something to think about. Keep up the good work!

-Jason

Re: Loopfile method

by wodSupport, Monday, December 12, 2005, 18:46 (6735 days ago) @ jason

Jason,

servers don't support that - so we have to do it on the client side. Question is who will do it - we (the component) or you (the application) - and it looks like the same thing. In LoopItem you have Skip argument where you can discard patterns you don't like so... You already have all you need.

Hope I helped.

Re: Loopfile method

by Jason, Monday, December 12, 2005, 19:45 (6735 days ago) @ wodSupport

That's a good point, thanks. I actually found the example in the help file (the Events section of the help file is still out of place in the tree, by the way).

A quick question, though. If I specify a MaxLevel of 1 (since 0 is unlimited), can I assume that the tree won't go any farther than the current directory, and won't loop in any subdirectories?

Thanks,

-Jason

Re: Loopfile method

by Jason, Monday, December 12, 2005, 19:53 (6735 days ago) @ Jason

Another questions I just thought of (sorry!). Since there is no LoopItem property, does that mean I can't use blocking, since I have to get the items from the event that is fired? Or is it relatively save to still use blocking?

Thanks again.

-Jason

Re: Loopfile method

by wodSupport, Monday, December 12, 2005, 20:05 (6735 days ago) @ Jason

Jason,

yes, if you specify 1 for MaxLevel, you will only look in current directory.

As for blocking, yes you can use it, but if you don't have events you're in trouble - first error that happens will cause GetFiles/PutFiles to stop due that error.

Re: Loopfile method

by Jason, Monday, December 12, 2005, 20:30 (6735 days ago) @ wodSupport

As for blocking, yes you can use it, but if you don't have events you're in trouble - first error that happens will cause GetFiles/PutFiles to stop due that error.

Meaning that I can use the GetFiles/PutFiles methods in blocking mode, but I still have to define events for them? What happens if I don't put any code in those event subroutines?

It may be easier just to parse the ListItem property anyway. Dealing with events is a little harder, as I'd be worried that my main code would finish or jump to the next section before all the LoopEvent Events fired.

Maybe a LoopItem Collection Property that you could use in blocking mode might be a good idea for the future?

-Jason

Re: Loopfile method

by wodSupport, Monday, December 12, 2005, 20:51 (6735 days ago) @ Jason

Jason,

if you need to loop only one folder, then perhaps using these recursive GetFiles method isn't best option for you. You may have better chance if you just call ListDir or perhaps ListAttributes?