GNURLOPT_FTP_USE_PRET(3)
π GNURLOPT_FTP_USE_PRET(3) π
bestie, welcome to the curl_easy_setopt options manual β this page is all about CURLOPT_FTP_USE_PRET, aka the tiny FTP switch with main-character energy. π
πΈ NAME πΈ
CURLOPT_FTP_USE_PRET β enable the PRET command
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_USE_PRET, long
enable);
π DESCRIPTION π
okay so you pass a long here. If the value is 1, it tells curl to send a PRET command before PASV (and EPSV). Certain FTP servers, mainly drftpd, require this non-standard command for directory listings as well as up and downloads in PASV mode. Has no effect when using the active FTP transfers mode. periodt. π¦
π DEFAULT π
0 β no cap, that's the default. π«Ά
π¦ PROTOCOLS π¦
FTP only, bestie. π
π EXAMPLE π
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/old-server/file.txt");
/* a drftpd server, do it! */
curl_easy_setopt(curl, CURLOPT_FTP_USE_PRET, 1L);
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
π AVAILABILITY π
Added in 7.20.0 β vintage but still slaying. β
π RETURN VALUE π
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. π«Ά
β SEE ALSO β
π that's the whole vibe, bestie. this page is from libcurl 7.37.0, dated 19 Jun 2014, and it's the GNURLOPT_FTP_USE_PRET(3) manual page. mwah πβ¨
π¦ 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