cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: How to recursively delete folders

From: G. T. Stresen-Reuter <tedmasterweb_at_gmail.com>
Date: Tue, 9 Sep 2008 17:14:10 +0100

On Sep 9, 2008, at 7:33 AM, Wei Weng wrote:

> 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

Thanks for the feedback Wei. It was my suspicion that this behavior
was outside the scope of cURL. I was just hoping there was a "delete"
equivalent for --ftp-create-dirs...

Off to write some shell scripts...

Ted

-------------------------------------------------------------------
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