CURLOPT_POSTQUOTE.3 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. .\" generated by cd2nroff 0.1 from CURLOPT_POSTQUOTE.md
  2. .TH CURLOPT_POSTQUOTE 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_POSTQUOTE \- (S)FTP commands to run after the transfer
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_POSTQUOTE,
  9. struct curl_slist *cmds);
  10. .fi
  11. .SH DESCRIPTION
  12. Pass a pointer to a linked list of FTP or SFTP commands to pass to the server
  13. after your FTP transfer request. The commands are only issued if no error
  14. occur. The linked list should be a fully valid list of struct curl_slist
  15. structs properly filled in as described for \fICURLOPT_QUOTE(3)\fP.
  16. Disable this operation again by setting a NULL to this option.
  17. .SH DEFAULT
  18. NULL
  19. .SH PROTOCOLS
  20. This functionality affects ftp and sftp
  21. .SH EXAMPLE
  22. .nf
  23. int main(void)
  24. {
  25. struct curl_slist *cmdlist = NULL;
  26. cmdlist = curl_slist_append(cmdlist, "RNFR source-name");
  27. cmdlist = curl_slist_append(cmdlist, "RNTO new-name");
  28. CURL *curl = curl_easy_init();
  29. if(curl) {
  30. CURLcode res;
  31. curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/foo.bin");
  32. /* pass in the FTP commands to run after the transfer */
  33. curl_easy_setopt(curl, CURLOPT_POSTQUOTE, cmdlist);
  34. res = curl_easy_perform(curl);
  35. curl_easy_cleanup(curl);
  36. }
  37. }
  38. .fi
  39. .SH AVAILABILITY
  40. Added in curl 7.1
  41. .SH RETURN VALUE
  42. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  43. .SH SEE ALSO
  44. .BR CURLOPT_PREQUOTE (3),
  45. .BR CURLOPT_QUOTE (3)