Getting files recursively: skip files/directories that cannot be read?
You'd probably have to do a bit more typing yourself then, and write a directory walker like this one:
public static string[] FindAllFiles(string rootDir) {
var pathsToSearch = new Queue<string>();
var foundFiles = new List<string>();
pathsToSearch.Enqueue(rootDir);
while (pathsToSearch.Count > 0) {
var dir = pathsToSearch.Dequeue();
try {
var files = Directory.GetFiles(dir);
foreach (var file in Directory.GetFiles(dir)) {
foundFiles.Add(file);
}
foreach (var subDir in Directory.GetDirectories(dir)) {
pathsToSearch.Enqueue(subDir);
}
} catch (Exception /* TODO: catch correct exception */) {
// Swallow. Gulp!
}
}
return foundFiles.ToArray();
}