cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: How can I get Directory listing with HTTP

From: Scott Haneda <talklists_at_newgeo.com>
Date: Mon, 17 May 2010 13:23:11 -0700

On May 17, 2010, at 2:32 AM, Avinash <pavinash_at_gmail.com> wrote:

> I want to know if there is any way to get the directory listing of a
> HTTP URL using cURL ?
> Thanks in advance.

I believe that will depend on the resourse you are requesting and how
it is configured. If the HTTP host does not have directory listings
enabled or are using a default index page, then no, you can not get
curl to show you more than the host shows naturally.

Other protocols like FTP will allow it, by default, but since you
explicitly mention HTTP I think the answer is it depends.

Load the URL and if you get a directory listing in your browser, you
can and will get that same listing with curl. It will be somewhat HTML
formatted, which you will have to clean up a bit if you just want the
directories and files in your result set.

--
Scott * If you contact me off list replace talklists@ with scott@ *
(Sent from a mobile device)
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-05-17