CURLOPT_WILDCARDMATCH.3 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2018, 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.haxx.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. .\" **************************************************************************
  22. .\"
  23. .TH CURLOPT_WILDCARDMATCH 3 "May 18, 2018" "libcurl 7.61.1" "curl_easy_setopt options"
  24. .SH NAME
  25. CURLOPT_WILDCARDMATCH \- enable directory wildcard transfers
  26. .SH SYNOPSIS
  27. #include <curl/curl.h>
  28. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_WILDCARDMATCH, long onoff);
  29. .SH DESCRIPTION
  30. Set \fIonoff\fP to 1 if you want to transfer multiple files according to a
  31. file name pattern. The pattern can be specified as part of the
  32. \fICURLOPT_URL(3)\fP option, using an fnmatch-like pattern (Shell Pattern
  33. Matching) in the last part of URL (file name).
  34. By default, libcurl uses its internal wildcard matching implementation. You
  35. can provide your own matching function by the
  36. \fICURLOPT_FNMATCH_FUNCTION(3)\fP option.
  37. A brief introduction of its syntax follows:
  38. .RS
  39. .IP "* - ASTERISK"
  40. \&ftp://example.com/some/path/\fB*.txt\fP (for all txt's from the root
  41. directory). Only two asterisks are allowed within the same pattern string.
  42. .RE
  43. .RS
  44. .IP "? - QUESTION MARK"
  45. Question mark matches any (exactly one) character.
  46. \&ftp://example.com/some/path/\fBphoto?.jpeg\fP
  47. .RE
  48. .RS
  49. .IP "[ - BRACKET EXPRESSION"
  50. The left bracket opens a bracket expression. The question mark and asterisk have
  51. no special meaning in a bracket expression. Each bracket expression ends by the
  52. right bracket and matches exactly one character. Some examples follow:
  53. \fB[a-zA-Z0\-9]\fP or \fB[f\-gF\-G]\fP \- character interval
  54. \fB[abc]\fP - character enumeration
  55. \fB[^abc]\fP or \fB[!abc]\fP - negation
  56. \fB[[:\fP\fIname\fP\fB:]]\fP class expression. Supported classes are
  57. \fBalnum\fP,\fBlower\fP, \fBspace\fP, \fBalpha\fP, \fBdigit\fP, \fBprint\fP,
  58. \fBupper\fP, \fBblank\fP, \fBgraph\fP, \fBxdigit\fP.
  59. \fB[][-!^]\fP - special case \- matches only '\-', ']', '[', '!' or '^'. These
  60. characters have no special purpose.
  61. \fB[\\[\\]\\\\]\fP - escape syntax. Matches '[', ']' or '\\'.
  62. Using the rules above, a file name pattern can be constructed:
  63. \&ftp://example.com/some/path/\fB[a-z[:upper:]\\\\].jpeg\fP
  64. .RE
  65. .PP
  66. .SH PROTOCOLS
  67. This feature is only supported for FTP download.
  68. .SH EXAMPLE
  69. See https://curl.haxx.se/libcurl/c/ftp-wildcard.html
  70. .SH AVAILABILITY
  71. Added in 7.21.0
  72. .SH RETURN VALUE
  73. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  74. .SH "SEE ALSO"
  75. .BR CURLOPT_FNMATCH_FUNCTION "(3), " CURLOPT_URL "(3), "