GNURLOPT_FTP_USE_PRET(3)

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

πŸŽ€ 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