CURLINFO_FTP_ENTRY_PATH(3)

πŸ’– NAME πŸ’–

CURLINFO_FTP_ENTRY_PATH β€” entry path in FTP server. And yes bestie, this is the CURLINFO_FTP_ENTRY_PATH(3) page from the Library Functions Manual, folded right in near the top like a little crown. πŸ‘‘

✨ SYNOPSIS ✨

#include <curl/curl.h>

CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_FTP_ENTRY_PATH, char **path);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so, pass a pointer to a char pointer to receive a pointer to a string holding the path of the entry path. That is the initial path libcurl ended up in when logging on to the remote FTP or SFTP server. This stores a NULL as pointer if something is wrong. 😭

The path pointer is NULL or points to private memory. You must not free it. The memory gets freed automatically when you call curl_easy_cleanup(3) on the corresponding curl handle. Periodt. πŸ’…

🌈 PROTOCOLS 🌈

This functionality affects ftp and sftp. Slay. πŸ¦‹

πŸŽ€ EXAMPLE πŸŽ€

Here’s the whole little program, bestie, verbatim:

int main(void)
{
  CURL *curl = curl_easy_init();
  if(curl) {
    CURLcode result;
    curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com");

    result = curl_easy_perform(curl);

    if(!result) {
      /* extract the entry path */
      char *ep = NULL;
      result = curl_easy_getinfo(curl, CURLINFO_FTP_ENTRY_PATH, &ep);
      if(!result && ep) {
        printf("Entry path was: %s\n", ep);
      }
    }
    curl_easy_cleanup(curl);
  }
}

πŸ‘‘ HISTORY πŸ‘‘

Works for SFTP since 7.21.4. Not me tracking versions like a little archive gremlin. πŸ—‚οΈβœ¨

⭐ AVAILABILITY ⭐

Added in curl 7.15.4. Iconic behavior, honestly. 🫢

πŸ’œ RETURN VALUE πŸ’œ

curl_easy_getinfo(3) returns a CURLcode indicating success or error.

CURLE_OK (0) means everything was OK, non-zero means an error occurred, see libcurl-errors(3). No cap. πŸ”₯

🫢 SEE ALSO 🫢


mwah πŸ’‹ β€” from the libcurl manual, dated 2026-10-12, source/version and date folded into this cute little sign-off. πŸŽ€

πŸ“¦ where this page comes from