diff --git a/Aaru.CommonTypes b/Aaru.CommonTypes index c723c09aa..83d7e34f1 160000 --- a/Aaru.CommonTypes +++ b/Aaru.CommonTypes @@ -1 +1 @@ -Subproject commit c723c09aaad90b73b737aa2003c21bc17fa97b5f +Subproject commit 83d7e34f1bc52ac7811e67fa7aaf854be7989a4a diff --git a/Aaru.Filesystems/AppleDOS/File.cs b/Aaru.Filesystems/AppleDOS/File.cs index 0fe9698e0..d8f47a504 100644 --- a/Aaru.Filesystems/AppleDOS/File.cs +++ b/Aaru.Filesystems/AppleDOS/File.cs @@ -226,15 +226,6 @@ public sealed partial class AppleDOS return ErrorNumber.NoError; } - /// - public ErrorNumber MapBlock(string path, long fileBlock, out long deviceBlock) - { - deviceBlock = 0; - - // TODO: Not really important. - return !_mounted ? ErrorNumber.AccessDenied : ErrorNumber.NotImplemented; - } - ErrorNumber CacheFile(string path) { string[] pathElements = path.Split(new[] diff --git a/Aaru.Filesystems/AppleMFS/File.cs b/Aaru.Filesystems/AppleMFS/File.cs index 07fc5ffb9..ac521decf 100644 --- a/Aaru.Filesystems/AppleMFS/File.cs +++ b/Aaru.Filesystems/AppleMFS/File.cs @@ -40,56 +40,6 @@ namespace Aaru.Filesystems; // Information from Inside Macintosh Volume II public sealed partial class AppleMFS { - /// - public ErrorNumber MapBlock(string path, long fileBlock, out long deviceBlock) - { - deviceBlock = new long(); - - if(!_mounted) - return ErrorNumber.AccessDenied; - - string[] pathElements = path.Split(new[] - { - '/' - }, StringSplitOptions.RemoveEmptyEntries); - - if(pathElements.Length != 1) - return ErrorNumber.NotSupported; - - path = pathElements[0]; - - if(!_filenameToId.TryGetValue(path.ToLowerInvariant(), out uint fileId)) - return ErrorNumber.NoSuchFile; - - if(!_idToEntry.TryGetValue(fileId, out FileEntry entry)) - return ErrorNumber.NoSuchFile; - - if(fileBlock > entry.flPyLen / _volMdb.drAlBlkSiz) - return ErrorNumber.InvalidArgument; - - uint nextBlock = entry.flStBlk; - long relBlock = 0; - - while(true) - { - if(relBlock == fileBlock) - { - deviceBlock = ((nextBlock - 2) * _sectorsPerBlock) + _volMdb.drAlBlSt + (long)_partitionStart; - - return ErrorNumber.NoError; - } - - if(_blockMap[nextBlock] == BMAP_FREE || - _blockMap[nextBlock] == BMAP_LAST) - break; - - nextBlock = _blockMap[nextBlock]; - relBlock++; - } - - return ErrorNumber.InOutError; - } - /// public ErrorNumber GetAttributes(string path, out FileAttributes attributes) { diff --git a/Aaru.Filesystems/CPM/File.cs b/Aaru.Filesystems/CPM/File.cs index 9591b4577..d496ab0af 100644 --- a/Aaru.Filesystems/CPM/File.cs +++ b/Aaru.Filesystems/CPM/File.cs @@ -69,15 +69,6 @@ public sealed partial class CPM return ErrorNumber.NoError; } - // TODO: Implementing this would require storing the interleaving - /// - public ErrorNumber MapBlock(string path, long fileBlock, out long deviceBlock) - { - deviceBlock = 0; - - return !_mounted ? ErrorNumber.AccessDenied : ErrorNumber.NotImplemented; - } - /// public ErrorNumber OpenFile(string path, out IFileNode node) { diff --git a/Aaru.Filesystems/FAT/File.cs b/Aaru.Filesystems/FAT/File.cs index 3e7d49798..bfba0fcf4 100644 --- a/Aaru.Filesystems/FAT/File.cs +++ b/Aaru.Filesystems/FAT/File.cs @@ -40,33 +40,6 @@ namespace Aaru.Filesystems; public sealed partial class FAT { - /// - public ErrorNumber MapBlock(string path, long fileBlock, out long deviceBlock) - { - deviceBlock = 0; - - if(!_mounted) - return ErrorNumber.AccessDenied; - - ErrorNumber err = Stat(path, out FileEntryInfo stat); - - if(err != ErrorNumber.NoError) - return err; - - if(stat.Attributes.HasFlag(FileAttributes.Directory) && - !_debug) - return ErrorNumber.IsDirectory; - - uint[] clusters = GetClusters((uint)stat.Inode); - - if(fileBlock >= clusters.Length) - return ErrorNumber.InvalidArgument; - - deviceBlock = (long)(_firstClusterSector + (clusters[fileBlock] * _sectorsPerCluster)); - - return ErrorNumber.NoError; - } - /// public ErrorNumber GetAttributes(string path, out FileAttributes attributes) { diff --git a/Aaru.Filesystems/FATX/File.cs b/Aaru.Filesystems/FATX/File.cs index 6da08e741..d443bbd92 100644 --- a/Aaru.Filesystems/FATX/File.cs +++ b/Aaru.Filesystems/FATX/File.cs @@ -40,33 +40,6 @@ namespace Aaru.Filesystems; public sealed partial class XboxFatPlugin { - /// - public ErrorNumber MapBlock(string path, long fileBlock, out long deviceBlock) - { - deviceBlock = 0; - - if(!_mounted) - return ErrorNumber.AccessDenied; - - ErrorNumber err = Stat(path, out FileEntryInfo stat); - - if(err != ErrorNumber.NoError) - return err; - - if(stat.Attributes.HasFlag(FileAttributes.Directory) && - !_debug) - return ErrorNumber.IsDirectory; - - uint[] clusters = GetClusters((uint)stat.Inode); - - if(fileBlock >= clusters.Length) - return ErrorNumber.InvalidArgument; - - deviceBlock = (long)(_firstClusterSector + ((clusters[fileBlock] - 1) * _sectorsPerCluster)); - - return ErrorNumber.NoError; - } - /// public ErrorNumber GetAttributes(string path, out FileAttributes attributes) { diff --git a/Aaru.Filesystems/ISO9660/File.cs b/Aaru.Filesystems/ISO9660/File.cs index 75d5b444b..077687d64 100644 --- a/Aaru.Filesystems/ISO9660/File.cs +++ b/Aaru.Filesystems/ISO9660/File.cs @@ -44,32 +44,6 @@ namespace Aaru.Filesystems; public sealed partial class ISO9660 { - /// - public ErrorNumber MapBlock(string path, long fileBlock, out long deviceBlock) - { - deviceBlock = 0; - - if(!_mounted) - return ErrorNumber.AccessDenied; - - ErrorNumber err = GetFileEntry(path, out DecodedDirectoryEntry entry); - - if(err != ErrorNumber.NoError) - return err; - - if(entry.Flags.HasFlag(FileFlags.Directory) && - !_debug) - return ErrorNumber.IsDirectory; - - // TODO: Multi-extents - if(entry.Extents.Count > 1) - return ErrorNumber.NotImplemented; - - deviceBlock = entry.Extents[0].extent + fileBlock; - - return ErrorNumber.NoError; - } - /// public ErrorNumber GetAttributes(string path, out FileAttributes attributes) { diff --git a/Aaru.Filesystems/LisaFS/Extent.cs b/Aaru.Filesystems/LisaFS/Extent.cs index 4e901dea8..30cdd4f86 100644 --- a/Aaru.Filesystems/LisaFS/Extent.cs +++ b/Aaru.Filesystems/LisaFS/Extent.cs @@ -36,15 +36,6 @@ namespace Aaru.Filesystems; public sealed partial class LisaFS { - /// - public ErrorNumber MapBlock(string path, long fileBlock, out long deviceBlock) - { - deviceBlock = 0; - - // TODO: Not really important. - return ErrorNumber.NotImplemented; - } - /// Searches the disk for an extents file (or gets it from cache) /// Error. /// File identifier. diff --git a/Aaru.Filesystems/Opera/File.cs b/Aaru.Filesystems/Opera/File.cs index be448fede..73f0ea51c 100644 --- a/Aaru.Filesystems/Opera/File.cs +++ b/Aaru.Filesystems/Opera/File.cs @@ -38,28 +38,6 @@ namespace Aaru.Filesystems; public sealed partial class OperaFS { - /// - public ErrorNumber MapBlock(string path, long fileBlock, out long deviceBlock) - { - deviceBlock = 0; - - if(!_mounted) - return ErrorNumber.AccessDenied; - - ErrorNumber err = GetFileEntry(path, out DirectoryEntryWithPointers entry); - - if(err != ErrorNumber.NoError) - return err; - - if((entry.Entry.flags & FLAGS_MASK) == (uint)FileFlags.Directory && - !_debug) - return ErrorNumber.IsDirectory; - - deviceBlock = entry.Pointers[0] + fileBlock; - - return ErrorNumber.NoError; - } - /// public ErrorNumber GetAttributes(string path, out FileAttributes attributes) { diff --git a/Aaru.Filesystems/UCSDPascal/File.cs b/Aaru.Filesystems/UCSDPascal/File.cs index 026be5890..eef523e01 100644 --- a/Aaru.Filesystems/UCSDPascal/File.cs +++ b/Aaru.Filesystems/UCSDPascal/File.cs @@ -38,14 +38,6 @@ namespace Aaru.Filesystems; // Information from Call-A.P.P.L.E. Pascal Disk Directory Structure public sealed partial class PascalPlugin { - /// - public ErrorNumber MapBlock(string path, long fileBlock, out long deviceBlock) - { - deviceBlock = 0; - - return !_mounted ? ErrorNumber.AccessDenied : ErrorNumber.NotImplemented; - } - /// public ErrorNumber GetAttributes(string path, out FileAttributes attributes) {