cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: How to recursively delete folders

From: Wei Weng <wweng_at_acedsl.com>
Date: Tue, 09 Sep 2008 02:33:15 -0400

G. T. Stresen-Reuter wrote:
> Hi,
>
> I'm relatively new to cURL so please be patient with me.
>
> I'm trying to use cURL to synchronize data between servers for which
> I only have FTP access.
>
> I'm able to delete individual files well enough (an example on how to
> do this in the man page would be a great addition...), but I haven't
> found a way to delete non-empty directories. I realize this may be a
> shortcoming of the protocol, but most modern FTP clients offer a
> "force delete" or "recursive delete" option and I thought I'd ask the
> list if something like this exists with cURL. I haven't seen any
> documentation hinting that this is possible so the list is my last
> resort.
>
> Thanks in advance and I look forward to hearing from anyone who
> thinks they could lend a hand.
>
> Sincerely,
>
> Ted Stresen-Reuter
> http://tedmasterweb.com
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
> FAQ: http://curl.haxx.se/docs/faq.html
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

Dear Ted:

I don't think curl should be helping FTP protocol to do something that was not
specified in RFCs.

You can

1) Enumerate the list of folders under your FTP path.
2) Remove those folders, respectively.

Thanks
Wei

-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2008-09-09