I have seen questions answered where people use the GetFiles method in a loop and pass some filter like *.mp3|*.wav
I am looking for all files, i.e. *.*
in the directory and it's subdirectories (there are many files). Users can choose to ignore specific filters (dynamic) when getting the files. The problem is that all getting all files and then removing files of a type will leave the list almost empty, but it takes a lot of time to get the files. Which is not ideal.
Use case:
GetFiles *.*
returns 300,000+ files
280,000+ of them are jpg files
GetFiles *.jpg
returns these 280,000+ files
Remove these 280,000+ files from 300,000+ files leaving only 20,000 or so files
It takes a lot of time to do this process. Is there a simpler way of doing this? Any help appreciated, thanks.