J
janderson
Hi gang,
I have a win32 C# app that needs to recursively search for a particular
file type really fast. It always searches the same place for these files.
I'm using Directory.GetDirectories and Directory.GetFiles to do it
currently. Because I know the location is the same every time I build a
cache of all the files and directories. If a directory changes I update
its contents on startup of the app.
Unfortunately when I do a last-date-of-modification check on a directory
it only reports on changes of files that are directly under it. So I
have to check every single directly rather then simply checking the
parent directory.
While I get a significant improvement when none of the directories
change (its much faster to load a file with all the entries in it then
to do a directory search). In particular the first time the app loads
up and has to search every file (around 100,000 and growing) which is
painfully slow (2 or 3 minutes to start up the app).
What techniques/APIs can I use to speed up file searching?
Is there a way to more directly look at the raw data that make up the
file-tables?
Cheers
I have a win32 C# app that needs to recursively search for a particular
file type really fast. It always searches the same place for these files.
I'm using Directory.GetDirectories and Directory.GetFiles to do it
currently. Because I know the location is the same every time I build a
cache of all the files and directories. If a directory changes I update
its contents on startup of the app.
Unfortunately when I do a last-date-of-modification check on a directory
it only reports on changes of files that are directly under it. So I
have to check every single directly rather then simply checking the
parent directory.
While I get a significant improvement when none of the directories
change (its much faster to load a file with all the entries in it then
to do a directory search). In particular the first time the app loads
up and has to search every file (around 100,000 and growing) which is
painfully slow (2 or 3 minutes to start up the app).
What techniques/APIs can I use to speed up file searching?
Is there a way to more directly look at the raw data that make up the
file-tables?
Cheers