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
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms