Sha256: a3e37b0ab8d4af297fef94a8bd3c4a640882e86f71bc5cea235388baf402165e
Contents?: true
Size: 592 Bytes
Versions: 43
Compression:
Stored size: 592 Bytes
Contents
using System.IO; using System.Collections.Generic; public static class FileSystemUtil { public static IEnumerable<string> GetFiles(string path) { Queue<string> queue = new Queue<string>(); queue.Enqueue(path); while (queue.Count > 0) { path = queue.Dequeue(); if (!Directory.Exists(path)) continue; foreach (string subDir in Directory.GetDirectories(path)) { queue.Enqueue(subDir); } string[] files = null; files = Directory.GetFiles(path); if (files != null) { for(int i = 0 ; i < files.Length ; i++) { yield return files[i]; } } } } }
Version data entries
43 entries across 43 versions & 1 rubygems