GNURLOPT_APPEND(3)

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

πŸ’– NAME πŸ’–

Okay bestie, welcome to the GNURLOPT_APPEND(3) page β€” it's one of the curl_easy_setopt options manual pages, and today's main character is CURLOPT_APPEND: enable appending to the remote file. Not me being obsessed with FTP uploads, but here we are πŸ’….

✨ SYNOPSIS ✨

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_APPEND, long append);

πŸ¦‹ DESCRIPTION πŸ¦‹

Lowkey simple: you pass a long parameter set to 1, and that tells the library to append to the remote file instead of overwrite it. The way that this is only useful when uploading to an FTP site? Fr fr, that's the whole vibe.

πŸŽ€ DEFAULT πŸŽ€

0 (disabled) β€” so by default the append behavior is not on, no cap.

🌈 PROTOCOLS 🌈

The one and only protocol here is FTP.

πŸ“ EXAMPLE πŸ“

CURL *curl = curl_easy_init();
if(curl) {

  curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/dir/to/newfile");
  curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
  curl_easy_setopt(curl, CURLOPT_APPEND, 1L);

  curl_easy_perform(curl);
}

πŸ‘‘ AVAILABILITY πŸ‘‘

This option was known as CURLOPT_FTPAPPEND up to 7.16.4 β€” so if you're time-traveling through curl history, iykyk.

πŸ’œ RETURN VALUE πŸ’œ

Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. Periodt.

πŸ”₯ SEE ALSO πŸ”₯


Signed off with the very cute combo of libcurl 7.37.0 and the date 17 Jun 2014 β€” this GNURLOPT_APPEND(3) page ate and left no crumbs 🫢✨

πŸ“¦ where this page comes from