1CURLINFO_FTP_ENTRY_PATH(3) curl_easy_getinfo optionsCURLINFO_FTP_ENTRY_PATH(3)
2
3
4

NAME

6       CURLINFO_FTP_ENTRY_PATH - get entry path in FTP server
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_FTP_ENTRY_PATH, char **path);
12

DESCRIPTION

14       Pass a pointer to a char pointer to receive a pointer to a string hold‐
15       ing the path of the entry path. That is the initial path libcurl  ended
16       up  in  when logging on to the remote FTP server. This stores a NULL as
17       pointer if something is wrong.
18
19       The path pointer will be NULL or pointing to private  memory  you  MUST
20       NOT free - it gets freed when you call curl_easy_cleanup(3) on the cor‐
21       responding CURL handle.
22

PROTOCOLS

24       FTP(S) and SFTP
25

EXAMPLE

27       CURL *curl = curl_easy_init();
28       if(curl) {
29         curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com");
30
31         res = curl_easy_perform(curl);
32
33         if(!res) {
34           /* extract the entry path */
35           char *ep = NULL;
36           res = curl_easy_getinfo(curl, CURLINFO_FTP_ENTRY_PATH, &ep);
37           if(!res && ep) {
38             printf("Entry path was: %s\n", ep);
39           }
40         }
41         curl_easy_cleanup(curl);
42       }
43

AVAILABILITY

45       Added in 7.15.4. Works for SFTP since 7.21.4
46

RETURN VALUE

48       Returns CURLE_OK if the option is supported,  and  CURLE_UNKNOWN_OPTION
49       if not.
50

SEE ALSO

52       curl_easy_getinfo(3), curl_easy_setopt(3),
53
54
55
56libcurl 7.85.0                   May 17, 2022       CURLINFO_FTP_ENTRY_PATH(3)
Impressum