prevnext   » WIT: Wiimms ISO Tools » Guides » Wildcards

Wildcards

Contents

1.   Introduction

Usually wildcards are managed by the calling shell. So if you use for excample ./path/*.wbfs, the shell searches the files, expand the command line, so that the tools gets a list of files, something like ./path/a.wbfs ./path/b.wbfs ./path/c.wbfs. This list can become very, very long, so that the permitted characters for the command line are no longer sufficient.

Another problem is the use of wildcards in options. So --recurse *.wbfs expands to --recurse a.wbfs b.wbfs. Only the first file a.wbfs is considered as a parameter of the option.

For this case, the tools evaluate so-called wildcards for some commands and options by themself. In the above examples, it would then only have to be prevented that the outer shell evaluates the wildcards. This is usually done by quoting the parameters. For the example of above, use --recurse "./path/*.wbfs".

The following sections describe how placeholders are resolved.

2.   Simple Wildcards

The SZS tools choose between doing a simple string match and wildcard matching by checking if the pattern contains one of these wildcard characters: *, ?, #, [, { and TAB. This check is done for every directory and for the base name of the path.

3.   Wildcard **

A special case is the wildcard **. It is recognized only at the beginning of a path component. Optionally it can be followed by a range specification to declare the minimum and/or maximum recursion (sub-directory) depth. The following list explains all allowed variants:
**
This matches any number (≥0) sub-directories.
**A
If A is an unsigned integer, then it matches exact A sub-directories.
**A-
If A is an unsigned integer, then it matches from A to unlimited sub-directories.
**A-B
If A and B are unsigned integers, then it matches from A to B sub-directories.
**-B
If B is an unsigned integer, then it matches from 0 to B sub-directories.
Due to a programming error, ** does not work correctly. The recursion depth was always 1 level higher than specified. So level 0 was never possible.

The error is included up to version v3.05a and has been fixed with version v3.06a.