cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: delete incomplete files

From: Patrick Monnerat <Patrick.Monnerat_at_datasphere.ch>
Date: Tue, 2 Dec 2014 18:07:30 +0100

 
Timo Lange wrote:

> Unfortunately curl creates an (empty) file in my filesystem which then
can't be processed by the rest of my projects algorithm.

YOU created the file using the fopen() call, not curl.

> Is there any way to delete files after aborting the download?

What about:
.
.
.
       /* Perform the request, res will get the return code */
       res = curl_easy_perform(curl);
       curl_easy_cleanup(curl);
       fclose(fp);
       /* Check for errors */
       if(res != CURLE_OK) {
          fprintf(stderr, "curl_easy_perform() failed\n");
          unlink(store_path);
       }
   }
.
.
.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-12-02