Holy cow, I wrote a book!
The FindFirstFile function
is not a SQL query.
It's a very simple directory enumerator.
There is a slightly fancier version called
but even that function doesn't add much at present
beyond filtering for directories or devices.
You don't get to pass it sort criteria like
or "return the files/directories sorted smallest file first",
"return the files/directories in reverse order of creation"
The only filtering you can provide are the wildcard pattern and
(if you use
FindFirstFileEx) a directory filter.
The wildcard language is very limited as well;
it can't express queries like "files whose extension are either .exe or .dll"
"all files whose extension is .c plus all directories regardless of extension".
You also can't ask it questions like,
"Tell me the total size of the files in this directory",
as we saw earlier,
this question is underspecified.
If you want to do any of those advanced queries,
you'll have to code it up yourself.
Hippie Tim is fond of saying,