CURLINFO_FTP_ENTRY_PATH.3 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. .\" generated by cd2nroff 0.1 from CURLINFO_FTP_ENTRY_PATH.md
  2. .TH CURLINFO_FTP_ENTRY_PATH 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLINFO_FTP_ENTRY_PATH \- get entry path in FTP server
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_FTP_ENTRY_PATH, char **path);
  9. .fi
  10. .SH DESCRIPTION
  11. Pass a pointer to a char pointer to receive a pointer to a string holding the
  12. path of the entry path. That is the initial path libcurl ended up in when
  13. logging on to the remote FTP server. This stores a NULL as pointer if
  14. something is wrong.
  15. The \fBpath\fP pointer is NULL or points to private memory. You MUST NOT free
  16. - it gets freed when you call \fIcurl_easy_cleanup(3)\fP on the corresponding
  17. CURL handle.
  18. .SH PROTOCOLS
  19. This functionality affects ftp only
  20. .SH EXAMPLE
  21. .nf
  22. int main(void)
  23. {
  24. CURL *curl = curl_easy_init();
  25. if(curl) {
  26. CURLcode res;
  27. curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com");
  28. res = curl_easy_perform(curl);
  29. if(!res) {
  30. /* extract the entry path */
  31. char *ep = NULL;
  32. res = curl_easy_getinfo(curl, CURLINFO_FTP_ENTRY_PATH, &ep);
  33. if(!res && ep) {
  34. printf("Entry path was: %s\\n", ep);
  35. }
  36. }
  37. curl_easy_cleanup(curl);
  38. }
  39. }
  40. .fi
  41. .SH HISTORY
  42. Works for SFTP since 7.21.4
  43. .SH AVAILABILITY
  44. Added in curl 7.15.4
  45. .SH RETURN VALUE
  46. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  47. .SH SEE ALSO
  48. .BR curl_easy_getinfo (3),
  49. .BR curl_easy_setopt (3)