cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Prevent directory listing when removing a file

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 14 Jan 2011 20:29:28 +0100 (CET)

On Fri, 14 Jan 2011, pcworld wrote:

> I want to delete files from a FTP server, but I always get a directory
> listing too, which I don't want. Deleting the file works.

...

> How can I prevent libcurl from doing a directory listing?

It gets the dir because you give it a URL that is a directory (the trailing
slash is implied when there's only a host name).

Set CURLOPT_NOBODY to 1, and I'm not sure if you also need to make the URL
identify a file, and it should stop.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-01-14