About File/Directory Masks...
A file name mask is used to selectively qualify
directory entries. A wildcard is a special character that can fill in for
missing letter(s) in file and directory names when used to add specificity to
OS commands. Although there are various ways to define the syntax and
semantics of a mask string, we will use the following rules:
- A mask has two parts, one for the file name and the other
for the extension. If an extension mask is included, it is separated from
the file mask by a period.
- A null file mask string qualifies all entries (regardless
of extension.)
- An ‘*’ qualifies all characters to the right and cannot be
followed by any characters (other than a period and an extension mask.)
There can be only one “*” per file name and/or extension mask. Thus a
single “*” would select all files without an extension. A “*.*” mask
would be the same as a null string and select all files with or without an
extension.
- A ‘?’ is a wild card for any single character and requires
the presence of a character in the file name to qualify. It may be used
multiple times in the file name and/or file extension mask.
Examples: *.* All
files
B* All
files beginning with ‘B’ and no extension
???*.C All
files of length at least 3 with ‘C’ extension
*.TXT All
files with “TXT” extension