ECL accepts four kind of wildcards in pathnames.
A single wildcard in a directory component, file name, type or
version is parsed as the :WILD value. See for instance
"*.*"
, "/home/*/.bashrc"
, etc
A double wildcard in a directory component, such as in
"/home/**/"
is parsed as the
:WILD-INFERIORS, and matches any number of directories,
even nested ones, such as: /home/
,
/home/jlr
, /home/jlr/lib
,
etc.
An isolated wildcard "log*.txt"
matches any number
of characters: log.txt
,
log_back.txt
, etc.
A question mark "log?.txt"
matches a single
character: log1.txt
,
log2.txt
...
The matching rules in Common Lisp and ECL are simple but have some unintuitive consequences when compared to Unix/DOS rules. The most important one is that directories must always end with a trailing slash /
, as in #p"/my/home/directory/"
. Second to that, NIL values can only be matched by NIL and :WILD. Hence, "*"
can only match files without file type. For some examples see Section 18.1.1.