curl-library
Re: ftp enhancement - FTP wildcard download
Date: Fri, 29 Jan 2010 00:37:05 +0100
On Thursday 28 of January 2010 23:42:03 Daniel Stenberg wrote:
> > Question is where to close "FILE *f" when it is changing.
>
> The wildcard callback is called before each transfer so it would basically
> say "here comes a new file". That means the previous file ended and it
> would have to be closed, or similar. A bit awkward I'd say (especially for
> the last downloaded file). Possibly we should consider one callback before
> and one after each file.
I think it's a trade-off anyway. Such a "callback" can be easily created on
the application level. Instead of setting a callback, the function may just
be called from two places:
1. once from the "open" callback - to close the previously opened file
(+ ensure that closing a not opened file is noop)
2. as soon as the curl_easy_perform() finishes - to close the last one
I'd prefer to keep the interface as simple as possible. However it might
become more interesting if the "close" callback brought some extra info
with itself.
As for the name, WILDCARDFUNCTION does not sound generic enough to me. What
about e.g. START_UNIT and eventually FINISH_UNIT (slightly inspired by the
API for gcc plug-ins - http://gcc.gnu.org/onlinedocs/gccint/Plugins.html )
Kamil
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-01-29