curl-library
RE: libcurl FTP - downloading a single file
Date: Tue, 25 Mar 2008 15:26:40 -0400
Is specifying the file name in the URL the only way? 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?
Here is another scenario.
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:
/home/sambuild/TESTS/CURL> ftp geniosol9
Connected to geniosol9.
220 geniosol9.hcl.com FTP server ready.
Name (geniosol9:sambuild):
331 Password required for sambuild.
Password:
230 User sambuild logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/export/home/sambuild" is current directory.
ftp> cd /tmp
250 CWD command successful.
ftp> pwd
257 "/tmp" is current directory.
ftp> get filesize
200 PORT command successful.
150 Opening BINARY mode data connection for filesize (8 bytes).
226 Transfer complete.
8 bytes received in 0.00 seconds (1.76 Kbytes/s)
ftp>
How can I implement this sequence of ftp commands with libcurl?
Thank you,
Alla
-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Joe Nardone
Sent: Monday, March 24, 2008 4:44 PM
To: libcurl development
Subject: Re: libcurl FTP - downloading a single file
On Mon, Mar 24, 2008 at 4:24 PM, Alla Bogolubov <abogolub_at_opentext.com>
wrote:
> Simple ftp example supplied with libcurl does not specify name of the
> file to be downloaded. Documentation does not specify it either.
> If I want to download a single file from a remote folder that
contains a
> handful of files, how do I specify the name of the file?
>
It doesn't?
http://curl.haxx.se/lxr/source/docs/examples/ftpget.c
60 curl_easy_setopt(curl, CURLOPT_URL,
61
"ftp://ftp.sunet.se/pub/www/utilities/curl/curl-7.9.2.tar.gz");
Received on 2008-03-25