GNURLOPT_TRANSFERTEXT(3)

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

okay bestie, this is GNURLOPT_TRANSFERTEXT(3), vibing in the curl_easy_setopt options manual. Yes, the title has the G and the NAME line has the C β€” both are real, we're not erasing anyone πŸ’….

🌸 NAME 🌸

CURLOPT_TRANSFERTEXT β€” request a text based transfer for FTP. πŸ’–

✨ SYNOPSIS ✨

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TRANSFERTEXT, long
       text);

πŸ¦‹ DESCRIPTION πŸ¦‹

When that parameter is 1, you're telling the library to use ASCII mode for FTP transfers, instead of the default binary transfer. πŸŽ€

tiny win32 caveat: on win32 systems it does not set stdout to binary mode. πŸ™ˆ

This option can be usable when transferring text data between systems that have different views on certain characters, such as newlines or similar. 😭

ngl, libcurl does not do a complete ASCII conversion when doing ASCII transfers over FTP. This is a known limitation/flaw that nobody has rectified. libcurl simply sets the mode to ASCII and performs a standard transfer. Periodt. πŸ’€

πŸŽ€ DEFAULT πŸŽ€

0, disabled. Off by default, bestie. 🫢

🌈 PROTOCOLS 🌈

FTP β€” that's the whole list. πŸ’–

🧚 EXAMPLE 🧚

Here's the example, code kept exactly as-is because code is sacred:

CURL *curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/textfile");
  curl_easy_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
  ret = curl_easy_perform(curl);
  curl_easy_cleanup(curl);
}

⭐ AVAILABILITY ⭐

Along with FTP ✨.

πŸ’œ RETURN VALUE πŸ’œ

Returns CURLE_OK if FTP is supported, and CURLE_UNKNOWN_OPTION if not. Simple as that, iykyk. πŸ”₯

πŸ¦‹ SEE ALSO πŸ¦‹

xoxo πŸ’– β€” this page is from libcurl 7.37.0, dated 17 Jun 2014. Hydrate, slay, and may your FTP transfers be exactly as ASCII as you intended 🫢🌈

πŸ“¦ where this page comes from