private void writeFiles(GDF src, CBinaryWriter bw, GDFDirTable table) { foreach (GDFDirEntry entry in table) { if (!entry.IsDirectory) { bw.Seek(entry.Sector * src.VolDesc.SectorSize, SeekOrigin.Begin); string path = ""; calcPath(table, entry, ref path); if (path.StartsWith(@"\")) { path = path.Remove(0, 1); } Console.WriteLine("+ Writing '" + path + "' at Sector 0x" + entry.Sector.ToString("X02") + "..."); src.WriteFileToStream(path, bw); } } foreach (GDFDirEntry entry2 in table) { if (entry2.IsDirectory && (entry2.SubDir != null)) { writeFiles(src, bw, entry2.SubDir); } } }
private void writeFiles(GDF src, CBinaryWriter bw, GDFDirTable table) { uint fileCount = src.FileCount; foreach (GDFDirEntry entry in table) { if (!entry.IsDirectory) { bw.Seek((long)(entry.Sector * src.VolDesc.SectorSize), SeekOrigin.Begin); string path = ""; this.calcPath(table, entry, ref path); if (path.StartsWith(@"\")) { path = path.Remove(0, 1); } this.progress += ((1f / ((float)fileCount)) * 0.45f) * 100f; base.ReportProgress((int)this.progress, "Writing '" + path + "' at Sector 0x" + entry.Sector.ToString("X02") + "..."); src.WriteFileToStream(path, bw); } } foreach (GDFDirEntry entry2 in table) { if (entry2.IsDirectory && (entry2.SubDir != null)) { this.writeFiles(src, bw, entry2.SubDir); } } }