Click here to Skip to main content
15,899,935 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Currently I am searching files in my filesystem by means of iterating only certain file extensions. Is this the closest I can come to querying the filesystem so to speak? Is there a way to shave off a bit of time while searching the filesystem?


thank you for your input!! :)
Posted
Comments
Sergey Alexandrovich Kryukov 2-Jun-12 19:34pm    
Not clear what is your query, so to speak... :-)
At to the performance, if it can be improved, it can be improved compared to something. With what?
--SA
Dale 2012 2-Jun-12 19:45pm    
the query would be the file extensions I am searching for I think and the performance would be compared to a normal iteration vs a faster method if any

1 solution

There are a few ways you can make file searching more efficient. One way to improve performance would be to use threading (the Task Parallel Library specifically). Another would be to cache the results instead of reading through the files over and over. Finally you could use a third-party library (I don't know of any free ones) that does indexing.

As far as any other way to "query" the file system, this is the way you do it. There isn't a way to write "queries" against the file system. You list all the files and search for the one you want inside that list.
 
Share this answer
 
Comments
Dale 2012 2-Jun-12 19:54pm    
thank you very much for that info

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900