0

Hi,

I have to get a directory file list, filtered on multiple extensions...and sorted!

I use this, which is the fastest way I've found to get dir content filtered on multiple extensions:

Dim ext As String() = {"*.jpg", "*.bmp","*png"}
Dim files As String() = ext.SelectMany(Function(f) Directory.GetFiles(romPath, f)).ToArray
Array.Sort(files)

and then use an array sort.

I was wondering (and this is my question ;)) if there would be a way to do the sorting IN the same main line? A kind of:

Dim files As String() = ext.SelectMany(Function(f) Directory.GetFiles(romPath, f).**Order By Name**.ToArray

and, if yes, if I would gain speed doing this instead of sorting the array at the end (but I would do my test and report..as soon as I get a solution!!)?
Thanks for your help!!

2
Contributors
1
Reply
8
Views
4 Years
Discussion Span
Last Post by Begginnerdev
0

Here is a link to an application that reads on a pretty low level. (MFT)

This would be quicker, but possibly some unnessesary overhead.

The problem alot of programmers have, including myself, is the habbit of over engineering an application. Sometimes simpler is better.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.