Path Patterns

Probably you have already used commands like dir *.txt (or ls *.txt on UN*X). This lists all files in the current directory where the name of the file ends with .txt. The *.txt stuff is called a path pattern.

With FMPP you also use path patterns to select certain files, say, in the modes setting, to tell FMPP which files to copy as is, and which files to execute as template. A path pattern looks like a path, but it can contain some special parts:

  • *: matches zero or more characers, except slash (/). For example a*c matches to abc, axyzc and ac, but not a/c.
  • ?: matches exactly one characer, except slash (/). For example a?c matches to abc, but not axyzc or ac or a/c.
  • **: This matches zero or more directories of the path. For example a/**/c matches to a/b/c, a/b/xyz/c and a/c. Another example: **/*.gif matches to foo.gif, a/foo.gif and , a/b/foo.gif. Also, if you use ** at the end of the pattern, then it match with all file names as well. Thus, foo/** will match all files inside foo, such as foo/bar.txt or foo/sub/bar.txt. Furthermore, if the pattern ends with /, then it is considered as shorthand for /**, so foo/ is the same as foo/**.

If your operating system use something else instead of / (as \ on Windows), FMPP will internally convert the native paths to UN*X format, so do not worry about this. Just use slash in the patterns. (Or, in fact, you can even use the native "slash" in patterns, just it is not a good practice in general.)

Note that pattern as *.gif will match only the GIF files in the current directory. If you want to match all GIF files of the subdirectories (and sub-subdirectories, etc.) as well, use **/*.gif.

The meaning of "current directory" in FMPP depends on the concrete situation where you use the path. In most cases where you will use path patterns (as with the modes setting) it will be the source root directory. Also, the meaning of "root directory" is depends on where you use the path. That is, absolute path /foo.txt maybe means foo.txt in the source root directory (this is the typical), or in the output root directory, or in the real root directory of the file system, etc.