GNURLOPT_TRANSFERTEXT(3)
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 π¦
CURLOPT_CRLF(3),β yep, comma included π .
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
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, 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