Link to home
Start Free TrialLog in
Avatar of mannycalaveras
mannycalaveras

asked on

Multiple wildcard queries for FileInfo.getFiles

In a strange twist, the FileInfo.getFiles method does not respond well to queries for multiple wildcards, say for all image files (*.bmp, *.jpg, *.gif, ...).

Using multiple wildcards simply returns nothing, which I find pretty strange since I would have expected the object's behavior to be closely tied to Window's native file search.

So is there a quick an easy way to do this, or do I have to do multiple queries for each file extension?
ASKER CERTIFIED SOLUTION
Avatar of iboutchkine
iboutchkine

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mannycalaveras
mannycalaveras

ASKER

You mean search for all files and filter myself according to each file's extension?

That's a workable option. I don't like searching for file extensions separately since they do not end up being in alphabetical order this way...

I'll check that out. Although I would appreciate a definitive answer on whether or not there is a way integrated in .NET to do it without doing workarounds like that.
Seems that there isn't a better answer than doing it all manually, I'll just deal with it this way.