cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: libcurl FTP - downloading a single file

From: Alla Bogolubov <abogolub_at_opentext.com>
Date: Tue, 25 Mar 2008 16:04:13 -0400

Daniel,

It will put me into $HOME/tmp, not into /tmp. The goal is to CWD out of
the home directory tree.

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Daniel Stenberg
Sent: Tuesday, March 25, 2008 3:43 PM
To: libcurl development
Subject: RE: libcurl FTP - downloading a single file

On Tue, 25 Mar 2008, Alla Bogolubov wrote:

Please don't top-post!

> Is specifying the file name in the URL the only way?

Yes, the only sensible way at least.

> If, for example I want to emulate mget of number of files that meet
certain
> wild card mask (say *.txt), should I call
curl_easy_setopt(curl,CURLOPT_URL,
> REMOTE_URL) which includes file name for each file?

Yes, but you should only set one URL for each transfer since libcurl can
only
do one file per transfer.

> I login to ftp server with my credentials. I want to download a file
which
> is not located in my home directory tree. This is the sequence of
commands
> in UNIX ftp client:

> How can I implement this sequence of ftp commands with libcurl?

You set CURLOPT_URL to something like:

         ftp://sambuild:password@geniosol9//tmp/filesize

and invoke curl_easy_perform(). (Replace "password" with your actual
password.)

-- 
  Commercial curl and libcurl Technical Support:
http://haxx.se/curl.html
Received on 2008-03-25