cURL / Mailing Lists / curl-users / Single Mail

curl-users

Reusing open connections with FTP

From: G. T. Stresen-Reuter <tedmasterweb_at_gmail.com>
Date: Thu, 15 Jan 2009 19:30:18 +0000

I read somewhere that cURL will reuse open FTP connections for
multiple transfers to/from an FTP server (and probably to/from any
other type of server).

When using the cURL tool (rather than libcurl which probably has a
file pointer), how is this accomplished?

For example, if I have a series of files to be uploaded to varying
folders on the same server, how would the command look to make sure
the same connection gets used?

curl -T file1.txt ftp://myserver.com/uploads/ -T file2.txt ftp://myserver.com/images/
     -T file3.txt ftp://myserver.com/css/

vs. (3 separate commands)

curl -T file1.txt ftp://myserver.com/uploads/
curl -T file2.txt ftp://myserver.com/images/
curl -T file3.txt ftp://myserver.com/css/

I'm asking because I'm calling cURL from a bash script, currently one
bash for each file, and I doubt cURL is able to use the same
connection opened in a different process, but I may be wrong...

Thanks in advance.

Ted Stresen-Reuter

-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-01-15