directory wildcard

Arne arne at linux.nu
Fri May 18 15:10:34 PDT 2012


According to:
http://dlang.org/phobos/std_path.html#globMatch

it is possible to use wildcards spanning multiple directories.

assert (globMatch(`foo/foo\bar`, "f*b*r"));

But wildcards with dirEntries() seem less powerful.

`c:\partial*\path\*.d`

If I were to use:
absolutePath + filter! + globMatch

I would expand too many unrelated directories, no?

I happen to know in my case that 'partial*' will match exactly 
one directory, but I don't know the complete name...

So am I left with tokenizing dirSeparator and 'cd' into one 
directory at a time? Or am I missing some magic D function which 
does everything? (wouldn't be the first time that happened to me 
;) hence my question).





More information about the Digitalmars-d-learn mailing list