Yeah, John - I knew after I wrote that post that it might be confusing - I think your replies are making things clear.

So readdir() does not do a callback or exit - it returns the next entry in the directory. So you have to manage the loop, whereas the loop is internal to the other API - whose name I can't remember more than 5 minutes ago!!

I agree that callbacks are not intrinsically tied to repetitive processes - just that, in my experience, it seems the more typical use.


On 10/18/2012 9:27 AM, John Yeung wrote:
On Thu, Oct 18, 2012 at 10:21 AM, John Yeung <gallium.arsenide@xxxxxxxxx> wrote:
On Thu, Oct 18, 2012 at 12:58 AM, Vernon Hamberg
<vhamberg@xxxxxxxxxxxxxxx> wrote:
Now another API is readdir() - this one returns a structure for the NEXT
item it finds in the directory - so YOU have to run this in a loop until
no more objects are found. The first API itself contains the processing
loop - that first API seems to fit the idea, again, of the use of
callback functions or programs. Pretty neat!
Neat, yes. Callback? I don't see it. I think you have conflated the
repetitiveness with the callback concept.
Hmm... perhaps I misread you. Maybe you are saying that readdir()
indeed does NOT involve callbacks at all, and were specifically trying
to highlight the difference between Qp0lProcessSubtree() (which takes
a callback, and uses that callback in a loop) and readdir() (which
does not, and you have to do the loop yourself).

Sorry if my previous response misconstrued what you were trying to say.


Return to Archive home page | Return to MIDRANGE.COM home page