private void DumpDirectory(Directory dir, TextWriter writer, string indent) { foreach (DirectoryEntry dirEntry in dir.GetAllEntries(true)) { File file = GetFile(dirEntry.Reference); Directory asDir = file as Directory; writer.WriteLine(indent + "+-" + file.ToString() + " (" + file.IndexInMft + ")"); // Recurse - but avoid infinite recursion via the root dir... if (asDir != null && file.IndexInMft != 5) { DumpDirectory(asDir, writer, indent + "| "); } } }