Esempio n. 1
0
        public static List <FileRecord> GetFilesystemStructure(this CDReader reader)
        {
            var filenames = reader.GetFiles(reader.Root.FullName, "*.*", SearchOption.AllDirectories).Distinct().Select(n => n.TrimStart('\\')).ToList();
            var result    = new List <FileRecord>();

            foreach (var filename in filenames)
            {
                var clusterRange = reader.PathToClusters(filename);
                if (clusterRange.Length != 1)
                {
                    Log.Warn($"{filename} is split in {clusterRange.Length} ranges");
                }
                if (filename.EndsWith("."))
                {
                    Log.Warn($"Fixing potential mastering error in {filename}");
                }
                result.Add(new FileRecord(filename.TrimEnd('.'), clusterRange.Min(r => r.Offset), reader.GetFileLength(filename)));
            }
            return(result.OrderBy(r => r.StartSector).ToList());
        }