Implement MapBlock() in Xbox FAT.

This commit is contained in:
2019-04-14 11:38:20 +01:00
parent 55892f057a
commit 0121cdb6d8

View File

@@ -46,7 +46,17 @@ namespace DiscImageChef.Filesystems.FATX
deviceBlock = 0;
if(!mounted) return Errno.AccessDenied;
throw new NotImplementedException();
Errno err = Stat(path, out FileEntryInfo stat);
if(err != Errno.NoError) return err;
uint[] clusters = GetClusters((uint)stat.Inode);
if(fileBlock >= clusters.Length) return Errno.InvalidArgument;
deviceBlock = (long)(firstClusterSector + (clusters[fileBlock] - 1) * sectorsPerCluster);
return Errno.NoError;
}
public Errno GetAttributes(string path, out FileAttributes attributes)