We have a fairly large disk array with approximately 2-3 million XML files. The drive is formatted using NTFS, and we would like to search for a file system using wildcards. So something like * SomePartOfTheFilename * would be a typical search query.
We use .Net and find that using DirectoryInfo looks slow.
DirectoryInfo directoryInfo = new DirectoryInfo(directory);
List<FileInfo> fileInfos = directoryInfo.GetFiles(searchString, SearchOption.AllDirectories).ToList();
Using loops and recursion is also very slow.
Is there a lower level API that we can use to directly look for the NTFS index?
Using dir * SomePartOfTheFilename * / s from the command line is almost instantaneous. Is there anything that can be used?
source
share