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
12       **path);
13

DESCRIPTION

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

PROTOCOLS

25       FTP(S) and SFTP
26

EXAMPLE

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

AVAILABILITY

46       Added in 7.15.4. Works for SFTP since 7.21.4
47

RETURN VALUE

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

SEE ALSO

53       curl_easy_getinfo(3), curl_easy_setopt(3),
54
55
56
57libcurl 7.61.1                   May 06, 2017       CURLINFO_FTP_ENTRY_PATH(3)
Impressum