CURLOPT_PREQUOTE.3 1.5 KB

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