cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcurl, DELE and file globs like mdel

From: John Utz <John.Utz_at_dmx.com>
Date: Thu, 30 Sep 2010 10:47:31 -0700

Hello;

I am attempting to use the following code delete multiple files like mdel, but I get a 550:

"curl trouble:Quote command returned error Ftp=550 Ret=0"

I can delete a single file, but i can not delete a glob. Is there some way to do this durectly or do i need to do an additional step to get a file list and then loop thru the list deleting each file?

tnx for any guidance you guys can provide!

johnu

#include <stdio.h>
#include <curl/curl.h>

int
main(int argc, char* argv[])
{
  int iErr = -1;
  double dSiz = -1;
  CURL *pCrl;

  struct curl_slist *psCrlSls = NULL;

  pCrl = curl_easy_init())

  psCrlSls = curl_slist_append(psCrlSls, "DELE foodir/bar*");
  
  curl_easy_setopt(pCrl, CURLOPT_QUOTE, psCrlSls);
 
  if(iErr = curl_easy_perform(pCrl))
  {
     long lResFtp;
     int iErrGi = curl_easy_getinfo(pCrl, CURLINFO_RESPONSE_CODE, &lResFtp);
     printf("curl trouble:%s Ftp=%d Ret=%d\n", curl_easy_strerror(iErr),
            lResFtp, iErrGi);
  }

  return iErr;
}

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-09-30