curl-users
FTP and Deleting files, libcurl
Date: Sat, 29 Sep 2012 23:49:23 +0100 (BST)
Im trying to delete a block of files from an ftp server but im coming up against a problem.
There are 50000 files and i need to delete a specific range in the middle but what im seeing is that curl quits on the 1st file that does not exist, and there are gaps int the sequential files.
my main code looks like this
curl_easy_setopt( curl, CURLOPT_URL, address);
curl_easy_setopt( curl, CURLOPT_USERNAME, username);
curl_easy_setopt( curl, CURLOPT_PASSWORD, password);
/* Switch on full protocol/debug output */
curl_easy_setopt( curl, CURLOPT_VERBOSE, 1L);
for( l=22755; l<30160; l++) {
char command[32];
sprintf( command, "DELE remarks/remark-%05d.txt", l);
headerlist = curl_slist_append(headerlist, command);
}
curl_easy_setopt(curl, CURLOPT_POSTQUOTE, headerlist);
/* Now run off and do what you've been told! */
res = curl_easy_perform(curl);
But the delete stops on the 1st file that does not exist, is there a way of telling curl to ignore the "not found" message, and just carry on deleting.
joolz
-------------------------------------------------------------------
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 2012-09-30