GNURLINFO_...ENTRY_PATH(3)
okay bestie, this page is GNURLINFO_...ENTRY_PATH(3) from the curl_easy_getinfo options manual β yes, the long title is right there, folded in with love π. The actual thing it documents is CURLINFO_FTP_ENTRY_PATH, and it's all about grabbing your FTP server entry path. Let's go.
π NAME π
CURLINFO_FTP_ENTRY_PATH β get entry path in FTP server. periodt.
β¨ SYNOPSIS β¨
Include this header like the icon you are:
#include <gnurl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_FTP_ENTRY_PATH, char
**path);
π DESCRIPTION π
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 server. If something goes wrong, it stores a NULL as the pointer.
The path pointer will be NULL or pointing to private memory you MUST NOT free β it gets freed when you call curl_easy_cleanup(3) on the corresponding CURL handle. Do not touch that memory, bestie, seriously π.
π PROTOCOLS π
FTP(S) and SFTP. no cap.
π EXAMPLE π
Here's the whole little vibe check in C:
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com");
res = curl_easy_perform(curl);
if(!res) {
/* extract the entry path */
char *ep = NULL;
res = curl_easy_getinfo(curl, CURLINFO_FTP_ENTRY_PATH, &ep);
if(!res && ep) {
printf("Entry path was: %s\n", ep);
}
}
curl_easy_cleanup(curl);
}
β AVAILABILITY β
Added in 7.15.4. Works for SFTP since 7.21.4 β those numbers are literally the timeline, bestie.
π₯ RETURN VALUE π₯
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. That's the whole mood.
π¦ SEE ALSO π¦
Go peek at curl_easy_getinfo(3), curl_easy_setopt(3), β yep, the original has that trailing comma too, keeping it exact π
.
mwah π«Ά this page was brought to you by libcurl 7.44.0, dated 12 Sep 2015 β iconic footer behavior, no cap.
π¦ 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