cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Question on using libcurl for FTP.

From: Wei Weng <wweng_at_kencast.com>
Date: Tue, 24 Jun 2003 10:44:58 -0400

On 23/06/03 23:32 +0200, Daniel Stenberg wrote:
> On Mon, 23 Jun 2003, Wei Weng wrote:
>
> > I have three questions on using libcurl for FTP download:
> >
> > 1: how do I download a directory recursively?
>
> You fetch the root dir, figure out the names of all subdirectories, then you
> get all the subdirectories and figure out what subdirectories they have and
> get their subdirectories...
>
> libcurl has no built-in functionality for recursive downloading. You need to
> provide that logic yourself.
>
> > 2: Is there anyway to set the option for it to download directory
> > recursively or NOT recursively?
>
> libcurl never downloads recursively, so no.
>
> > 3: Is there anyway to specify wildcard in filenames when downloading files?
> > say specify "ftp://myhost.com/pub/*.txt" will only download all the files
> > with extension "txt".
>
> Same here. This is not provided by libcurl, libcurl will only provide you with
> a list of directory entries, you decide what to do with it.
>
> --
> Daniel Stenberg -- curl: been grokking URLs since 1998
>
Since I am such a newbie to libcurl, how do I get the FTP directory listing?
Should I issue a "LIST" command? And if that is way to do it, how do I get
the content returned by "LIST" command?

Thanks!

Wei

-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
Received on 2003-06-24