public static IEnumerable <string> ListDirRecursive(this IHleIoDriver HleIoDriver, string Path) { foreach (var Item in HleIoDriver.ListDir(Path)) { yield return("/" + (Path + "/" + Item.Name).TrimStart('/')); if (Item.Stat.Attributes.HasFlag(IOFileModes.Directory)) { foreach (var InnerItem in HleIoDriver.ListDirRecursive(Path + "/" + Item.Name)) { yield return(InnerItem); } } } }