GNURLOPT_PREQUOTE(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

hey bestie! welcome to GNURLOPT_PREQUOTE(3), straight from the curl_easy_setopt options manual πŸ’…βœ¨

πŸŽ€ NAME πŸŽ€

CURLOPT_PREQUOTE β€” commands to run before an FTP transfer, periodt πŸ’–

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PREQUOTE,
                          struct curl_slist *cmds);

✨ DESCRIPTION ✨

okay so you pass a pointer to a linked list of FTP commands, and those get passed to the server after the transfer type is set 🫢

The linked list should be a fully valid list of struct curl_slist structs, properly filled in as described for CURLOPT_QUOTE(3). Like, don’t hand it a cursed list, bestie 😭

You can disable this operation again by setting a NULL to this option. yep, NULL = off 🌸

🚨 SFTP check: CURLOPT_QUOTE(3) and CURLOPT_POSTQUOTE(3) work for SFTP, but this option does not. The way that distinction matters, fr fr πŸ’€

πŸ“ DEFAULT πŸ“

NULL β€” that’s the default, no cap ✨

🌈 PROTOCOLS 🌈

FTP πŸ’–

🧚 EXAMPLE 🧚

struct curl_slist *cmdlist = NULL;
cmdlist = curl_slist_append(cmdlist, "SYST");

curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/foo.bin");

  /* pass in the FTP commands to run */
  curl_easy_setopt(curl, CURLOPT_PREQUOTE, cmdlist);

  ret = curl_easy_perform(curl);

  curl_easy_cleanup(curl);
}

πŸ’« AVAILABILITY πŸ’«

It’s available along with the protocol support β€” iykyk πŸ¦‹

πŸ‘‘ RETURN VALUE πŸ‘‘

Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. iconic behavior πŸ’…

πŸ’œ SEE ALSO πŸ’œ


okay that’s the page, bestie β€” source/version + date: libcurl 7.37.0, 17 Jun 2014. byeee πŸŽ€βœ¨πŸ’–

πŸ“¦ where this page comes from