Simple Filename Patterns
Commands like Put or PutDir allow selection of multiple files or filtering of files (and/or folders) to which the command applies.
A filename pattern can consist of the special characters * and ?.. The asterisk stands for an arbirary part of the filename, i.e. where the * appears in the pattern there can be zero, one or more characters in the file name. The character ? stands for exactly one arbitrary character.
Fore more complex uses of those, you will also be interested in the ForEach command which allows other commands (namely such that do not support file patterns) to be executed based on a patterned file list.
Examples:
*.txt
daten*
a01*fil
dat0*
da0??b.*
b1?da*.ba?
Multiple Filename Patterns
If required, a filename/foldername pattern parameter can consist of multiple patterns. These need to be put inside square brackets and separated by semicolons.
A pattern which starts with the ~ character is an exclusion. Names which match an exclusion will be considered a non-match and will be ignored. Some commands also offer a similar mechanism applying not to the files files, but to the name of subfolders to process (or ignore).
Note:. The patterns or filenames provided in these lists only apply to individual file or directory names, i.e. it is not possible to combine parts of a directory path, like userfiles/etc or userfiles/*.dat.
Examples:
RemoteDelete "[*.tmp; *.temp]" (Delete files ending with '.tmp' or '.temp')
Get "[*.doc; *.txt; *.text]" (Get all doc, txt and text files)
Get "[*; ~*.tmp]" (Get all files which do not end with 'tmp')
Get "[*.doc; ~a*; ~b*]" (Get all doc files except doc files which start with 'a' or 'b')
PutDir -r "[*.html; *.cgi; *.php]", "[*; ~_*"] (Upload all html, cgi and php
files from the current directory and all subdirectories, but excluding those which begin with '_')
PutDir -r "[*.c; *.cpp; *.h]", "[prod*; cgi*"] (Upload all .c, .cpp and .h files
from the current directory and all subdirectories who's names begin with 'prod' or 'cgi')
← Back to Script Commands