curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: delete and rename files via ftp using libcurl

From: Daniel Stenberg via curl-library <curl-library_at_lists.haxx.se>
Date: Mon, 21 Nov 2022 15:33:09 +0100 (CET)

On Mon, 21 Nov 2022, Darius Panahy via curl-library wrote:

> I can do this with:
>
> curl_easy_setopt(curl, CURLOPT_URL,ftp://<host>/);
> curl_easy_setopt(curl, CURLOPT_USERPWD, "xxx:yyy");
> cmdlist = curl_slist_append(cmdlist, "DELE /c/temp/ftp/a.txt");
> curl_easy_setopt(curl, CURLOPT_QUOTE, cmdlist);
> res = curl_easy_perform(curl);
>
> however after running the DELE command, curl also performs a LIST which I do
> not want since this could be the LIST of a large folder.

You can set CURLOPT_NOBODY which I believe will prevent it from downlading the
"body" of the transfer.

-- 
  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://curl.se/support.html
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2022-11-21