cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Question about the libcurl API?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 18 Apr 2001 08:36:24 +0200 (MET DST)

On Tue, 17 Apr 2001, Michael Saunders wrote:

> I am new to libcurl and have a question. Does the libcurl API have
> functions that would allow me to list the directories and files from a
> specified ftp address?

It does allow you to list ftp directories, yes. It does not separate files
from directories though, as that is beyond what the FTP protocol offers in
directory lists.

> What I need to do is provide browsing capability from our application's
> file dialog. In order to do this in Motif I have to know which files are
> directories and which are regular files.

The problem is that the ftp LIST command returns a directory listing that is
"platform dependent". There's nothing in the FTP spec that says what that
listing should look like. The receiver will have to parse the response to
detect what entries that are files and which are directories.

I'd be very happy to bring such functionality to libcurl, but as of today
there is none.

There exists ftp list parsing libraries "out there" like Berstein's
http://cr.yp.to/ftpparse.html (which has a license that might be a bit
annoying to include in libcurl).

Wget has a cloned version of that, but then wget is GPL and that is certainly
not possible to include in libcurl.

> do I have to go about it the hard way and try to change directories into
> each file and see if it fails to determine which are regular files?

That's a way too, but I'd opt for directory parsing first.

-- 
  Daniel Stenberg -- curl project maintainer -- http://curl.haxx.se/
_______________________________________________
Curl-library mailing list
Curl-library_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-library
Received on 2001-04-18