Remove FNM_PERIOD to make patterns not completely crazy
FNM_PERIOD
Treat the `.' character specially if it appears at the beginning of string.
If this flag is set, wildcard constructs in pattern cannot match `.' as the
first character of string. If you set both FNM_PERIOD and FNM_FILE_NAME,
then the special treatment applies to `.' following `/' as well as to `.'
at the beginning of string. (The shell uses the FNM_PERIOD and
FNM_FILE_NAME flags together for matching file names.)
So essentially shell-like semantics results in you needing patterns like *(/*)*(/.*)*(/*)
at the beginning of string for full directory match.
Edited by Seppo Yli-Olli