GNURLOPT_POSTQUOTE(3)
π GNURLOPT_POSTQUOTE(3) π
okay bestie, quick vibe check: this page lives in the curl_easy_setopt options manual, and it's all about CURLOPT_POSTQUOTE. buckle up, it's giving βpost-transfer FTP commandsβ energy π¦β¨
πΈ NAME πΈ
CURLOPT_POSTQUOTE β (S)FTP commands to run after the transfer π
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_POSTQUOTE, struct
curl_slist *cmds);
π DESCRIPTION π
So you pass a pointer to a linked list of FTP or SFTP commands, and those get passed to the server after your FTP transfer request. The commands will only be run if no error occurred β like, no error, no after-party π. The linked list should be a fully valid list of struct curl_slist structs properly filled in as described for CURLOPT_QUOTE(3).
Want to turn it off again? Disable this operation by setting a NULL to this option. bye π
π DEFAULT π
NULL β iconically empty, and that's the default, periodt π
π PROTOCOLS π
SFTP and FTP. that's the whole guest list π«Ά
π¦ EXAMPLE π¦
Here's the example, copied with love and zero edits β code is sacred, fr fr π:
struct curl_slist *cmdlist = NULL;
cmdlist = curl_slist_append(cmdlist, "RNFR source-name");
cmdlist = curl_slist_append(cmdlist, "RNTO new-name");
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/foo.bin");
/* pass in the FTP commands to run after the transfer */
curl_easy_setopt(curl, CURLOPT_POSTQUOTE, cmdlist);
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
β AVAILABILITY β
If support for the protocols are built-in. yes, that's the condition, bestie π«
π RETURN VALUE π
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. slay if supported, sad little CURLE_UNKNOWN_OPTION if not π
π₯ SEE ALSO π₯
CURLOPT_QUOTE(3),CURLOPT_PREQUOTE(3), β go click these next, bestie, they're in the same quote-y family π
β¨ source/version check: libcurl 7.37.0, dated 17 Jun 2014 β mwah, and that's the GNURLOPT_POSTQUOTE(3) tea πβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms