cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: listing ftp directory with patterns

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Tue, 25 Nov 2003 18:10:23 +0100 (CET)

On Tue, 25 Nov 2003, Rolf Jakob wrote:

> I would like to use a URL like : ftp://user@host/directory/subdir/*.csv to
> get the listing of the /directory/subdir/ with all files matching the *.csv
> pattern. curl lists the whole subdir ignoring the pattern.

Right, that is not a URL curl will do anything with.

> Is there any way to get this without patching curl ?

Actually there is, but I'm not sure you like it:

Set CURLOPT_CUSTOMREQUEST to 'LIST *.csv' and use the URL as
"ftp://user@host/directory/subdir/".

This will of course give you the server's idea of what a server listing should
look like. That is entirely server-specific (even though many look similar).

> Background : Currently I use the libftp, but I would like to try libcurl as
> most functions in libftp won't time out and you cannot break them with a
> SIGALRM.

libcurl is not offering access to everything you can do with ftp, but for
simple transfers it should be adequate.

-- 
    Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/
 [[ Do not post private mails to this email address. They won't reach me. ]]
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
Received on 2003-11-25