1 .\" **************************************************************************
3 .\" * Project ___| | | | _ \| |
4 .\" * / __| | | | |_) | |
5 .\" * | (__| |_| | _ <| |___
6 .\" * \___|\___/|_| \_\_____|
8 .\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
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.
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.
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
21 .\" **************************************************************************
23 .TH CURLOPT_WILDCARDMATCH 3 "February 03, 2016" "libcurl 7.59.0" "curl_easy_setopt options"
26 CURLOPT_WILDCARDMATCH \- enable directory wildcard transfers
28 #include <curl/curl.h>
30 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_WILDCARDMATCH, long onoff);
32 Set \fIonoff\fP to 1 if you want to transfer multiple files according to a
33 file name pattern. The pattern can be specified as part of the
34 \fICURLOPT_URL(3)\fP option, using an fnmatch-like pattern (Shell Pattern
35 Matching) in the last part of URL (file name).
37 By default, libcurl uses its internal wildcard matching implementation. You
38 can provide your own matching function by the
39 \fICURLOPT_FNMATCH_FUNCTION(3)\fP option.
41 A brief introduction of its syntax follows:
44 \&ftp://example.com/some/path/\fB*.txt\fP (for all txt's from the root
48 .IP "? - QUESTION MARK"
49 Question mark matches any (exactly one) character.
51 \&ftp://example.com/some/path/\fBphoto?.jpeg\fP
54 .IP "[ - BRACKET EXPRESSION"
55 The left bracket opens a bracket expression. The question mark and asterisk have
56 no special meaning in a bracket expression. Each bracket expression ends by the
57 right bracket and matches exactly one character. Some examples follow:
59 \fB[a-zA-Z0\-9]\fP or \fB[f\-gF\-G]\fP \- character interval
61 \fB[abc]\fP - character enumeration
63 \fB[^abc]\fP or \fB[!abc]\fP - negation
65 \fB[[:\fP\fIname\fP\fB:]]\fP class expression. Supported classes are
66 \fBalnum\fP,\fBlower\fP, \fBspace\fP, \fBalpha\fP, \fBdigit\fP, \fBprint\fP,
67 \fBupper\fP, \fBblank\fP, \fBgraph\fP, \fBxdigit\fP.
69 \fB[][-!^]\fP - special case \- matches only '\-', ']', '[', '!' or '^'. These
70 characters have no special purpose.
72 \fB[\\[\\]\\\\]\fP - escape syntax. Matches '[', ']' or '\\'.
74 Using the rules above, a file name pattern can be constructed:
76 \&ftp://example.com/some/path/\fB[a-z[:upper:]\\\\].jpeg\fP
80 This feature is only supported for FTP download.
82 See https://curl.haxx.se/libcurl/c/ftp-wildcard.html
86 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
88 .BR CURLOPT_FNMATCH_FUNCTION "(3), " CURLOPT_URL "(3), "