CURLOPT_FTP_FILEMETHOD.3 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .\"
  25. .TH CURLOPT_FTP_FILEMETHOD 3 "January 02, 2023" "libcurl 7.88.1" "curl_easy_setopt options"
  26. .SH NAME
  27. CURLOPT_FTP_FILEMETHOD \- select directory traversing method for FTP
  28. .SH SYNOPSIS
  29. .nf
  30. #include <curl/curl.h>
  31. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_FILEMETHOD,
  32. long method);
  33. .SH DESCRIPTION
  34. Pass a long telling libcurl which \fImethod\fP to use to reach a file on a
  35. FTP(S) server.
  36. This option exists because some server implementations are not compliant to
  37. what the standards say should work.
  38. The argument should be one of the following alternatives:
  39. .IP CURLFTPMETHOD_MULTICWD
  40. libcurl does a single CWD operation for each path part in the given URL. For
  41. deep hierarchies this means many commands. This is how RFC1738 says it should
  42. be done. This is the default but the slowest behavior.
  43. .IP CURLFTPMETHOD_NOCWD
  44. libcurl does no CWD at all. libcurl will do SIZE, RETR, STOR etc and give a
  45. full path to the server for all these commands. This is the fastest behavior.
  46. .IP CURLFTPMETHOD_SINGLECWD
  47. libcurl does one CWD with the full target directory and then operates on the
  48. file \&"normally" (like in the multicwd case). This is somewhat more standards
  49. compliant than 'nocwd' but without the full penalty of 'multicwd'.
  50. .SH DEFAULT
  51. CURLFTPMETHOD_MULTICWD
  52. .SH PROTOCOLS
  53. FTP
  54. .SH EXAMPLE
  55. .nf
  56. CURL *curl = curl_easy_init();
  57. if(curl) {
  58. curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/1/2/3/4/new.txt");
  59. curl_easy_setopt(curl, CURLOPT_FTP_FILEMETHOD,
  60. (long)CURLFTPMETHOD_SINGLECWD);
  61. ret = curl_easy_perform(curl);
  62. curl_easy_cleanup(curl);
  63. }
  64. .fi
  65. .SH AVAILABILITY
  66. Added in 7.15.1
  67. .SH RETURN VALUE
  68. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  69. .SH "SEE ALSO"
  70. .BR CURLOPT_DIRLISTONLY "(3), " CURLOPT_FTP_SKIP_PASV_IP "(3), "