I know how to use the DirectoryInfo.GetFiles(), but I do not think this is the fastest way to go. These "FileInfo" objects seem a little bit big...
Why do I need it? Well, I tried to achieve my search tool with WDS, but I give up. The OleDB connection is horrible, strange errors without any explanation. So what I am going to do is:
Rebuild the file index in SQL2008.
Currently there are a few open points to check, mostly regarding maintenance:
- How do I get all files into the DB
- How would I keep the DB in sync with the file system
I will try how much resources the FileSystemWatcher needs later, for now I am looking for the fastest way to get all files from a drive, the full path as string would be sufficient.
So, assume I give you this:
List<string> allFiles =
How would you fill it really fast :-) And btw
new FileInfo("D:").GetFiles("*",SearchOption.All)
is not the best way, I think. Reason 1, possible overhead. More severe reason 2: throws in case of not accessible path (which will most surely happen after 1.5 Mio files)..