cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: ftp multiple files

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 10 Mar 2003 17:53:36 +0100 (CET)

On Mon, 10 Mar 2003, Felton, Mark wrote:

(cc'ing this reply to the libcurl mailing list, this is libcurl talk so
please take it on that list.)

> I am trying to ftp multiple files in a single session. The sample code
> forces me to re-establish the ftp connection for each file I send.

How can sample code force you into doing things? It's just a sample. Can't
you just edit the code to do what you want it to?

> Can someone tell me how to set up multiple files to be transferred during a
> single session? I am using C language.

Using pseudo code and the easy-interface approach:

        curl_easy_init();

        while ( urls left to transfer) {

                [set options with curl_easy_setopt() ]

                curl_easy_perform();

        }

        curl_easy_cleanup();

The persistant.c example also shows how this can be done.

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-03-10