mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Move filesystem metadata to GetInformation method for information only plugins.
This commit is contained in:
Submodule Aaru.CommonTypes updated: 8d7f99e0d3...b7366181b4
@@ -707,29 +707,37 @@ public sealed partial class Sidecar
|
||||
|
||||
List<FileSystem> lstFs = new();
|
||||
|
||||
foreach(IFilesystem plugin in plugins.Filesystems.Values)
|
||||
foreach(Type pluginType in plugins.Filesystems.Values)
|
||||
try
|
||||
{
|
||||
if(_aborted)
|
||||
return;
|
||||
|
||||
if(!plugin.Identify(image, partition))
|
||||
if(Activator.CreateInstance(pluginType) is not IFilesystem fs)
|
||||
continue;
|
||||
|
||||
if(plugin is IReadOnlyFilesystem fsPlugin &&
|
||||
fsPlugin.Mount(image, partition, encoding, null, null) == ErrorNumber.NoError)
|
||||
if(!fs.Identify(image, partition))
|
||||
continue;
|
||||
|
||||
if(fs is IReadOnlyFilesystem rofs &&
|
||||
rofs.Mount(image, partition, encoding, null, null) == ErrorNumber.NoError)
|
||||
{
|
||||
UpdateStatus(string.Format(Localization.Core.Mounting_0, fsPlugin.Metadata.Type));
|
||||
UpdateStatus(string.Format(Localization.Core.Mounting_0, rofs.Metadata.Type));
|
||||
|
||||
fsPlugin.Metadata.Contents = Files(fsPlugin);
|
||||
rofs.Metadata.Contents = Files(rofs);
|
||||
|
||||
fsPlugin.Unmount();
|
||||
lstFs.Add(rofs.Metadata);
|
||||
Statistics.AddFilesystem(rofs.Metadata.Type);
|
||||
|
||||
rofs.Unmount();
|
||||
}
|
||||
else
|
||||
plugin.GetInformation(image, partition, out _, encoding);
|
||||
{
|
||||
fs.GetInformation(image, partition, encoding, out _, out FileSystem fsMetadata);
|
||||
|
||||
lstFs.Add(plugin.Metadata);
|
||||
Statistics.AddFilesystem(plugin.Metadata.Type);
|
||||
lstFs.Add(fsMetadata);
|
||||
Statistics.AddFilesystem(fsMetadata.Type);
|
||||
}
|
||||
}
|
||||
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
catch
|
||||
@@ -764,29 +772,37 @@ public sealed partial class Sidecar
|
||||
|
||||
List<FileSystem> lstFs = new();
|
||||
|
||||
foreach(IFilesystem plugin in plugins.Filesystems.Values)
|
||||
foreach(Type pluginType in plugins.Filesystems.Values)
|
||||
try
|
||||
{
|
||||
if(_aborted)
|
||||
return;
|
||||
|
||||
if(!plugin.Identify(image, wholePart))
|
||||
if(Activator.CreateInstance(pluginType) is not IFilesystem fs)
|
||||
continue;
|
||||
|
||||
if(plugin is IReadOnlyFilesystem fsPlugin &&
|
||||
fsPlugin.Mount(image, wholePart, encoding, null, null) == ErrorNumber.NoError)
|
||||
if(!fs.Identify(image, wholePart))
|
||||
continue;
|
||||
|
||||
if(fs is IReadOnlyFilesystem rofs &&
|
||||
rofs.Mount(image, wholePart, encoding, null, null) == ErrorNumber.NoError)
|
||||
{
|
||||
UpdateStatus(string.Format(Localization.Core.Mounting_0, fsPlugin.Metadata.Type));
|
||||
UpdateStatus(string.Format(Localization.Core.Mounting_0, rofs.Metadata.Type));
|
||||
|
||||
fsPlugin.Metadata.Contents = Files(fsPlugin);
|
||||
rofs.Metadata.Contents = Files(rofs);
|
||||
|
||||
fsPlugin.Unmount();
|
||||
lstFs.Add(rofs.Metadata);
|
||||
Statistics.AddFilesystem(rofs.Metadata.Type);
|
||||
|
||||
rofs.Unmount();
|
||||
}
|
||||
else
|
||||
plugin.GetInformation(image, wholePart, out _, encoding);
|
||||
{
|
||||
fs.GetInformation(image, wholePart, encoding, out _, out FileSystem fsMetadata);
|
||||
|
||||
lstFs.Add(plugin.Metadata);
|
||||
Statistics.AddFilesystem(plugin.Metadata.Type);
|
||||
lstFs.Add(fsMetadata);
|
||||
Statistics.AddFilesystem(fsMetadata.Type);
|
||||
}
|
||||
}
|
||||
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
catch
|
||||
|
||||
@@ -528,7 +528,7 @@ public sealed partial class Sidecar
|
||||
|
||||
List<FileSystem> lstFs = new();
|
||||
|
||||
foreach(IFilesystem plugin in plugins.Filesystems.Values)
|
||||
foreach(Type pluginType in plugins.Filesystems.Values)
|
||||
try
|
||||
{
|
||||
if(_aborted)
|
||||
@@ -538,14 +538,17 @@ public sealed partial class Sidecar
|
||||
return;
|
||||
}
|
||||
|
||||
if(!plugin.Identify(image, partition))
|
||||
if(Activator.CreateInstance(pluginType) is not IFilesystem fs)
|
||||
continue;
|
||||
|
||||
plugin.GetInformation(image, partition, out _, encoding);
|
||||
lstFs.Add(plugin.Metadata);
|
||||
Statistics.AddFilesystem(plugin.Metadata.Type);
|
||||
if(!fs.Identify(image, partition))
|
||||
continue;
|
||||
|
||||
dskType = plugin.Metadata.Type switch
|
||||
fs.GetInformation(image, partition, encoding, out _, out FileSystem fsMetadata);
|
||||
lstFs.Add(fsMetadata);
|
||||
Statistics.AddFilesystem(fsMetadata.Type);
|
||||
|
||||
dskType = fsMetadata.Type switch
|
||||
{
|
||||
"Opera" => MediaType.ThreeDO,
|
||||
"PC Engine filesystem" => MediaType.SuperCDROM2,
|
||||
@@ -586,7 +589,7 @@ public sealed partial class Sidecar
|
||||
Sequence = xmlTrk.Sequence.Number
|
||||
};
|
||||
|
||||
foreach(IFilesystem plugin in plugins.Filesystems.Values)
|
||||
foreach(Type pluginType in plugins.Filesystems.Values)
|
||||
try
|
||||
{
|
||||
if(_aborted)
|
||||
@@ -596,14 +599,17 @@ public sealed partial class Sidecar
|
||||
return;
|
||||
}
|
||||
|
||||
if(!plugin.Identify(image, xmlPart))
|
||||
if(Activator.CreateInstance(pluginType) is not IFilesystem fs)
|
||||
continue;
|
||||
|
||||
plugin.GetInformation(image, xmlPart, out _, encoding);
|
||||
lstFs.Add(plugin.Metadata);
|
||||
Statistics.AddFilesystem(plugin.Metadata.Type);
|
||||
if(!fs.Identify(image, xmlPart))
|
||||
continue;
|
||||
|
||||
dskType = plugin.Metadata.Type switch
|
||||
fs.GetInformation(image, xmlPart, encoding, out _, out FileSystem fsMetadata);
|
||||
lstFs.Add(fsMetadata);
|
||||
Statistics.AddFilesystem(fsMetadata.Type);
|
||||
|
||||
dskType = fsMetadata.Type switch
|
||||
{
|
||||
"Opera" => MediaType.ThreeDO,
|
||||
"PC Engine filesystem" => MediaType.SuperCDROM2,
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -43,8 +42,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of the AO-DOS filesystem</summary>
|
||||
public sealed partial class AODOS : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public string Name => Localization.AODOS_Name;
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -73,11 +73,13 @@ public sealed partial class AODOS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
information = "";
|
||||
Encoding = Encoding.GetEncoding("koi8-r");
|
||||
ErrorNumber errno = imagePlugin.ReadSector(0, out byte[] sector);
|
||||
metadata = new FileSystem();
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
return;
|
||||
@@ -88,7 +90,7 @@ public sealed partial class AODOS
|
||||
|
||||
sbInformation.AppendLine(Localization.Alexander_Osipov_DOS_file_system);
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
Clusters = imagePlugin.Info.Sectors,
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -39,8 +38,6 @@ namespace Aaru.Filesystems;
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Local")]
|
||||
public sealed partial class APFS : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -67,11 +67,12 @@ public sealed partial class APFS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = Encoding.UTF8;
|
||||
var sbInformation = new StringBuilder();
|
||||
Metadata = new FileSystem();
|
||||
metadata = new FileSystem();
|
||||
information = "";
|
||||
|
||||
if(partition.Start >= partition.End)
|
||||
@@ -105,7 +106,7 @@ public sealed partial class APFS
|
||||
|
||||
information = sbInformation.ToString();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Bootable = false,
|
||||
Clusters = nxSb.containerBlocks,
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -37,8 +36,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of Acorn's Advanced Data Filing System (ADFS)</summary>
|
||||
public sealed partial class AcornADFS : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public string Name => Localization.AcornADFS_Name;
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -259,11 +259,12 @@ public sealed partial class AcornADFS
|
||||
// TODO: Support big directories (ADFS-G?)
|
||||
// TODO: Find the real freemap on volumes with DiscRecord, as DiscRecord's discid may be empty but this one isn't
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-1");
|
||||
var sbInformation = new StringBuilder();
|
||||
Metadata = new FileSystem();
|
||||
metadata = new FileSystem();
|
||||
information = "";
|
||||
ErrorNumber errno;
|
||||
|
||||
@@ -321,7 +322,7 @@ public sealed partial class AcornADFS
|
||||
namebytes[(i * 2) + 1] = oldMap1.name[i];
|
||||
}
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Bootable = oldMap1.boot != 0, // Or not?
|
||||
Clusters = bytes / imagePlugin.Info.SectorSize,
|
||||
@@ -420,12 +421,12 @@ public sealed partial class AcornADFS
|
||||
|
||||
if(oldMap1.discId > 0)
|
||||
{
|
||||
Metadata.VolumeSerial = $"{oldMap1.discId:X4}";
|
||||
metadata.VolumeSerial = $"{oldMap1.discId:X4}";
|
||||
sbInformation.AppendFormat(Localization.Volume_ID_0_X4, oldMap1.discId).AppendLine();
|
||||
}
|
||||
|
||||
if(!ArrayHelpers.ArrayIsNullOrEmpty(namebytes))
|
||||
Metadata.VolumeName = StringHandlers.CToString(namebytes, Encoding);
|
||||
metadata.VolumeName = StringHandlers.CToString(namebytes, Encoding);
|
||||
|
||||
information = sbInformation.ToString();
|
||||
|
||||
@@ -527,7 +528,7 @@ public sealed partial class AcornADFS
|
||||
if(bytes > imagePlugin.Info.Sectors * imagePlugin.Info.SectorSize)
|
||||
return;
|
||||
|
||||
Metadata = new FileSystem();
|
||||
metadata = new FileSystem();
|
||||
|
||||
sbInformation.AppendLine(Localization.Acorn_Advanced_Disc_Filing_System);
|
||||
sbInformation.AppendLine();
|
||||
@@ -548,22 +549,22 @@ public sealed partial class AcornADFS
|
||||
|
||||
if(drSb.disc_id > 0)
|
||||
{
|
||||
Metadata.VolumeSerial = $"{drSb.disc_id:X4}";
|
||||
metadata.VolumeSerial = $"{drSb.disc_id:X4}";
|
||||
sbInformation.AppendFormat(Localization.Volume_ID_0_X4, drSb.disc_id).AppendLine();
|
||||
}
|
||||
|
||||
if(!ArrayHelpers.ArrayIsNullOrEmpty(drSb.disc_name))
|
||||
{
|
||||
string discname = StringHandlers.CToString(drSb.disc_name, Encoding);
|
||||
Metadata.VolumeName = discname;
|
||||
metadata.VolumeName = discname;
|
||||
sbInformation.AppendFormat(Localization.Volume_name_0, discname).AppendLine();
|
||||
}
|
||||
|
||||
information = sbInformation.ToString();
|
||||
|
||||
Metadata.Bootable |= drSb.bootoption != 0; // Or not?
|
||||
Metadata.Clusters = bytes / (ulong)(1 << drSb.log2secsize);
|
||||
Metadata.ClusterSize = (uint)(1 << drSb.log2secsize);
|
||||
Metadata.Type = FS_TYPE;
|
||||
metadata.Bootable |= drSb.bootoption != 0; // Or not?
|
||||
metadata.Clusters = bytes / (ulong)(1 << drSb.log2secsize);
|
||||
metadata.ClusterSize = (uint)(1 << drSb.log2secsize);
|
||||
metadata.Type = FS_TYPE;
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -37,8 +36,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of Amiga Fast File System (AFFS)</summary>
|
||||
public sealed partial class AmigaDOSPlugin : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public string Name => Localization.AmigaDOSPlugin_Name;
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -165,11 +165,12 @@ public sealed partial class AmigaDOSPlugin
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-1");
|
||||
var sbInformation = new StringBuilder();
|
||||
Metadata = new FileSystem();
|
||||
metadata = new FileSystem();
|
||||
information = null;
|
||||
ErrorNumber errno = imagePlugin.ReadSectors(0 + partition.Start, 2, out byte[] bootBlockSectors);
|
||||
|
||||
@@ -278,42 +279,42 @@ public sealed partial class AmigaDOSPlugin
|
||||
{
|
||||
case 0:
|
||||
sbInformation.Append(Localization.Amiga_Original_File_System);
|
||||
Metadata.Type = FS_TYPE_OFS;
|
||||
metadata.Type = FS_TYPE_OFS;
|
||||
|
||||
break;
|
||||
case 1:
|
||||
sbInformation.Append(Localization.Amiga_Fast_File_System);
|
||||
Metadata.Type = FS_TYPE_FFS;
|
||||
metadata.Type = FS_TYPE_FFS;
|
||||
|
||||
break;
|
||||
case 2:
|
||||
sbInformation.Append(Localization.Amiga_Original_File_System_with_international_characters);
|
||||
Metadata.Type = FS_TYPE_OFS;
|
||||
metadata.Type = FS_TYPE_OFS;
|
||||
|
||||
break;
|
||||
case 3:
|
||||
sbInformation.Append(Localization.Amiga_Fast_File_System_with_international_characters);
|
||||
Metadata.Type = FS_TYPE_FFS;
|
||||
metadata.Type = FS_TYPE_FFS;
|
||||
|
||||
break;
|
||||
case 4:
|
||||
sbInformation.Append(Localization.Amiga_Original_File_System_with_directory_cache);
|
||||
Metadata.Type = FS_TYPE_OFS;
|
||||
metadata.Type = FS_TYPE_OFS;
|
||||
|
||||
break;
|
||||
case 5:
|
||||
sbInformation.Append(Localization.Amiga_Fast_File_System_with_directory_cache);
|
||||
Metadata.Type = FS_TYPE_FFS;
|
||||
metadata.Type = FS_TYPE_FFS;
|
||||
|
||||
break;
|
||||
case 6:
|
||||
sbInformation.Append(Localization.Amiga_Original_File_System_with_long_filenames);
|
||||
Metadata.Type = FS_TYPE_OFS2;
|
||||
metadata.Type = FS_TYPE_OFS2;
|
||||
|
||||
break;
|
||||
case 7:
|
||||
sbInformation.Append(Localization.Amiga_Fast_File_System_with_long_filenames);
|
||||
Metadata.Type = FS_TYPE_FFS2;
|
||||
metadata.Type = FS_TYPE_FFS2;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -365,17 +366,17 @@ public sealed partial class AmigaDOSPlugin
|
||||
sbInformation.AppendFormat(Localization.Root_block_checksum_is_0, rootBlk.checksum).AppendLine();
|
||||
information = sbInformation.ToString();
|
||||
|
||||
Metadata.CreationDate = DateHandlers.AmigaToDateTime(rootBlk.cDays, rootBlk.cMins, rootBlk.cTicks);
|
||||
metadata.CreationDate = DateHandlers.AmigaToDateTime(rootBlk.cDays, rootBlk.cMins, rootBlk.cTicks);
|
||||
|
||||
Metadata.ModificationDate = DateHandlers.AmigaToDateTime(rootBlk.vDays, rootBlk.vMins, rootBlk.vTicks);
|
||||
metadata.ModificationDate = DateHandlers.AmigaToDateTime(rootBlk.vDays, rootBlk.vMins, rootBlk.vTicks);
|
||||
|
||||
Metadata.Dirty = rootBlk.bitmapFlag != 0xFFFFFFFF;
|
||||
Metadata.Clusters = blocks;
|
||||
Metadata.ClusterSize = blockSize;
|
||||
Metadata.VolumeName = diskName;
|
||||
Metadata.Bootable = bsum == bootBlk.checksum;
|
||||
metadata.Dirty = rootBlk.bitmapFlag != 0xFFFFFFFF;
|
||||
metadata.Clusters = blocks;
|
||||
metadata.ClusterSize = blockSize;
|
||||
metadata.VolumeName = diskName;
|
||||
metadata.Bootable = bsum == bootBlk.checksum;
|
||||
|
||||
// Useful as a serial
|
||||
Metadata.VolumeSerial = $"{rootBlk.checksum:X8}";
|
||||
metadata.VolumeSerial = $"{rootBlk.checksum:X8}";
|
||||
}
|
||||
}
|
||||
@@ -51,11 +51,11 @@ public sealed partial class AppleDOS : IReadOnlyFilesystem
|
||||
uint _usedSectors;
|
||||
Vtoc _vtoc;
|
||||
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public string Name => Localization.AppleDOS_Name;
|
||||
/// <inheritdoc />
|
||||
public Guid Id => new("8658A1E9-B2E7-4BCC-9638-157A31B0A700\n");
|
||||
|
||||
@@ -64,11 +64,13 @@ public sealed partial class AppleDOS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? new Apple2();
|
||||
information = "";
|
||||
var sb = new StringBuilder();
|
||||
metadata = new FileSystem();
|
||||
|
||||
int spt = imagePlugin.Info.Sectors == 455 ? 13 : 16;
|
||||
|
||||
@@ -97,7 +99,7 @@ public sealed partial class AppleDOS
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Bootable = true,
|
||||
Clusters = imagePlugin.Info.Sectors,
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -44,8 +43,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of the Apple Hierarchical File System (HFS)</summary>
|
||||
public sealed partial class AppleHFS : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -97,10 +97,12 @@ public sealed partial class AppleHFS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("macintosh");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
@@ -273,38 +275,38 @@ public sealed partial class AppleHFS
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
Metadata = new FileSystem();
|
||||
metadata = new FileSystem();
|
||||
|
||||
if(mdb.drVolBkUp > 0)
|
||||
{
|
||||
Metadata.BackupDate = DateHandlers.MacToDateTime(mdb.drVolBkUp);
|
||||
metadata.BackupDate = DateHandlers.MacToDateTime(mdb.drVolBkUp);
|
||||
}
|
||||
|
||||
Metadata.Bootable = bootBlockInfo != null || mdb.drFndrInfo0 != 0 || mdb.drFndrInfo3 != 0 ||
|
||||
metadata.Bootable = bootBlockInfo != null || mdb.drFndrInfo0 != 0 || mdb.drFndrInfo3 != 0 ||
|
||||
mdb.drFndrInfo5 != 0;
|
||||
|
||||
Metadata.Clusters = mdb.drNmAlBlks;
|
||||
Metadata.ClusterSize = mdb.drAlBlkSiz;
|
||||
metadata.Clusters = mdb.drNmAlBlks;
|
||||
metadata.ClusterSize = mdb.drAlBlkSiz;
|
||||
|
||||
if(mdb.drCrDate > 0)
|
||||
{
|
||||
Metadata.CreationDate = DateHandlers.MacToDateTime(mdb.drCrDate);
|
||||
metadata.CreationDate = DateHandlers.MacToDateTime(mdb.drCrDate);
|
||||
}
|
||||
|
||||
Metadata.Dirty = !mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.Unmounted);
|
||||
Metadata.Files = mdb.drFilCnt;
|
||||
Metadata.FreeClusters = mdb.drFreeBks;
|
||||
metadata.Dirty = !mdb.drAtrb.HasFlag(AppleCommon.VolumeAttributes.Unmounted);
|
||||
metadata.Files = mdb.drFilCnt;
|
||||
metadata.FreeClusters = mdb.drFreeBks;
|
||||
|
||||
if(mdb.drLsMod > 0)
|
||||
{
|
||||
Metadata.ModificationDate = DateHandlers.MacToDateTime(mdb.drLsMod);
|
||||
metadata.ModificationDate = DateHandlers.MacToDateTime(mdb.drLsMod);
|
||||
}
|
||||
|
||||
Metadata.Type = FS_TYPE;
|
||||
Metadata.VolumeName = StringHandlers.PascalToString(mdb.drVN, Encoding);
|
||||
metadata.Type = FS_TYPE;
|
||||
metadata.VolumeName = StringHandlers.PascalToString(mdb.drVN, Encoding);
|
||||
|
||||
if(mdb.drFndrInfo6 != 0 &&
|
||||
mdb.drFndrInfo7 != 0)
|
||||
Metadata.VolumeSerial = $"{mdb.drFndrInfo6:X8}{mdb.drFndrInfo7:X8}";
|
||||
metadata.VolumeSerial = $"{mdb.drFndrInfo6:X8}{mdb.drFndrInfo7:X8}";
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -38,8 +37,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of Apple Hierarchical File System Plus (HFS+)</summary>
|
||||
public sealed partial class AppleHFSPlus : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -97,10 +97,12 @@ public sealed partial class AppleHFSPlus
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = Encoding.BigEndianUnicode;
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
var vh = new VolumeHeader();
|
||||
|
||||
@@ -259,43 +261,43 @@ public sealed partial class AppleHFSPlus
|
||||
vh.drFndrInfo7 != 0)
|
||||
sb.AppendFormat(Localization.Mac_OS_X_Volume_ID_0_1, vh.drFndrInfo6, vh.drFndrInfo7).AppendLine();
|
||||
|
||||
Metadata = new FileSystem();
|
||||
metadata = new FileSystem();
|
||||
|
||||
if(vh.backupDate > 0)
|
||||
{
|
||||
Metadata.BackupDate = DateHandlers.MacToDateTime(vh.backupDate);
|
||||
metadata.BackupDate = DateHandlers.MacToDateTime(vh.backupDate);
|
||||
}
|
||||
|
||||
Metadata.Bootable |= vh.drFndrInfo0 != 0 || vh.drFndrInfo3 != 0 || vh.drFndrInfo5 != 0;
|
||||
Metadata.Clusters = vh.totalBlocks;
|
||||
Metadata.ClusterSize = vh.blockSize;
|
||||
metadata.Bootable |= vh.drFndrInfo0 != 0 || vh.drFndrInfo3 != 0 || vh.drFndrInfo5 != 0;
|
||||
metadata.Clusters = vh.totalBlocks;
|
||||
metadata.ClusterSize = vh.blockSize;
|
||||
|
||||
if(vh.createDate > 0)
|
||||
{
|
||||
Metadata.CreationDate = DateHandlers.MacToDateTime(vh.createDate);
|
||||
metadata.CreationDate = DateHandlers.MacToDateTime(vh.createDate);
|
||||
}
|
||||
|
||||
Metadata.Dirty = (vh.attributes & 0x100) != 0x100;
|
||||
Metadata.Files = vh.fileCount;
|
||||
Metadata.FreeClusters = vh.freeBlocks;
|
||||
metadata.Dirty = (vh.attributes & 0x100) != 0x100;
|
||||
metadata.Files = vh.fileCount;
|
||||
metadata.FreeClusters = vh.freeBlocks;
|
||||
|
||||
if(vh.modifyDate > 0)
|
||||
{
|
||||
Metadata.ModificationDate = DateHandlers.MacToDateTime(vh.modifyDate);
|
||||
metadata.ModificationDate = DateHandlers.MacToDateTime(vh.modifyDate);
|
||||
}
|
||||
|
||||
Metadata.Type = vh.signature switch
|
||||
metadata.Type = vh.signature switch
|
||||
{
|
||||
0x482B => FS_TYPE_HFSP,
|
||||
0x4858 => FS_TYPE_HFSX,
|
||||
_ => Metadata.Type
|
||||
_ => metadata.Type
|
||||
};
|
||||
|
||||
if(vh.drFndrInfo6 != 0 &&
|
||||
vh.drFndrInfo7 != 0)
|
||||
Metadata.VolumeSerial = $"{vh.drFndrInfo6:X8}{vh.drFndrInfo7:X8}";
|
||||
metadata.VolumeSerial = $"{vh.drFndrInfo6:X8}{vh.drFndrInfo7:X8}";
|
||||
|
||||
Metadata.SystemIdentifier = Encoding.ASCII.GetString(vh.lastMountedVersion);
|
||||
metadata.SystemIdentifier = Encoding.ASCII.GetString(vh.lastMountedVersion);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -58,11 +58,11 @@ public sealed partial class AppleMFS : IReadOnlyFilesystem
|
||||
byte[] _directoryTags;
|
||||
byte[] _bitmapTags;
|
||||
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public string Name => Localization.AppleMFS_Name;
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Guid Id => new("36405F8D-0D26-4066-6538-5DBF5D065C3A");
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
|
||||
@@ -58,10 +58,12 @@ public sealed partial class AppleMFS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? new MacRoman();
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
@@ -153,25 +155,25 @@ public sealed partial class AppleMFS
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
Metadata = new FileSystem();
|
||||
metadata = new FileSystem();
|
||||
|
||||
if(mdb.drLsBkUp > 0)
|
||||
{
|
||||
Metadata.BackupDate = DateHandlers.MacToDateTime(mdb.drLsBkUp);
|
||||
metadata.BackupDate = DateHandlers.MacToDateTime(mdb.drLsBkUp);
|
||||
}
|
||||
|
||||
Metadata.Bootable = bootBlockInfo != null;
|
||||
Metadata.Clusters = mdb.drNmAlBlks;
|
||||
Metadata.ClusterSize = mdb.drAlBlkSiz;
|
||||
metadata.Bootable = bootBlockInfo != null;
|
||||
metadata.Clusters = mdb.drNmAlBlks;
|
||||
metadata.ClusterSize = mdb.drAlBlkSiz;
|
||||
|
||||
if(mdb.drCrDate > 0)
|
||||
{
|
||||
Metadata.CreationDate = DateHandlers.MacToDateTime(mdb.drCrDate);
|
||||
metadata.CreationDate = DateHandlers.MacToDateTime(mdb.drCrDate);
|
||||
}
|
||||
|
||||
Metadata.Files = mdb.drNmFls;
|
||||
Metadata.FreeClusters = mdb.drFreeBks;
|
||||
Metadata.Type = FS_TYPE;
|
||||
Metadata.VolumeName = mdb.drVN;
|
||||
metadata.Files = mdb.drNmFls;
|
||||
metadata.FreeClusters = mdb.drFreeBks;
|
||||
metadata.Type = FS_TYPE;
|
||||
metadata.VolumeName = mdb.drVN;
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,6 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -39,8 +38,6 @@ namespace Aaru.Filesystems;
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Local")]
|
||||
public sealed partial class AtheOS : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -73,10 +73,12 @@ public sealed partial class AtheOS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
@@ -145,7 +147,7 @@ public sealed partial class AtheOS
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Clusters = (ulong)afsSb.num_blocks,
|
||||
ClusterSize = afsSb.block_size,
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -40,8 +39,6 @@ namespace Aaru.Filesystems;
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Local")]
|
||||
public sealed partial class BeFS : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -83,10 +83,12 @@ public sealed partial class BeFS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
@@ -217,7 +219,7 @@ public sealed partial class BeFS
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Clusters = (ulong)besb.num_blocks,
|
||||
ClusterSize = besb.block_size,
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -41,8 +40,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of the b-tree filesystem (btrfs)</summary>
|
||||
public sealed partial class BTRFS : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -81,11 +81,12 @@ public sealed partial class BTRFS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
|
||||
var sbInformation = new StringBuilder();
|
||||
Metadata = new FileSystem();
|
||||
metadata = new FileSystem();
|
||||
information = "";
|
||||
|
||||
ulong sbSectorOff = 0x10000 / imagePlugin.Info.SectorSize;
|
||||
@@ -183,7 +184,7 @@ public sealed partial class BTRFS
|
||||
|
||||
information = sbInformation.ToString();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Clusters = btrfsSb.total_bytes / btrfsSb.sectorsize,
|
||||
ClusterSize = btrfsSb.sectorsize,
|
||||
@@ -193,6 +194,6 @@ public sealed partial class BTRFS
|
||||
Type = FS_TYPE
|
||||
};
|
||||
|
||||
Metadata.FreeClusters = Metadata.Clusters - (btrfsSb.bytes_used / btrfsSb.sectorsize);
|
||||
metadata.FreeClusters = metadata.Clusters - (btrfsSb.bytes_used / btrfsSb.sectorsize);
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -37,8 +36,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of the filesystem used in 8-bit Commodore microcomputers</summary>
|
||||
public sealed partial class CBM : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public string Name => Localization.CBM_Name;
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -89,7 +89,8 @@ public sealed partial class CBM
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = new PETSCII();
|
||||
information = "";
|
||||
@@ -99,7 +100,7 @@ public sealed partial class CBM
|
||||
|
||||
sbInformation.AppendLine(Localization.Commodore_file_system);
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
Clusters = imagePlugin.Info.Sectors,
|
||||
@@ -138,8 +139,8 @@ public sealed partial class CBM
|
||||
sbInformation.AppendFormat(Localization.Disk_name_0, StringHandlers.CToString(cbmHdr.name, Encoding)).
|
||||
AppendLine();
|
||||
|
||||
Metadata.VolumeName = StringHandlers.CToString(cbmHdr.name, Encoding);
|
||||
Metadata.VolumeSerial = $"{cbmHdr.diskId}";
|
||||
metadata.VolumeName = StringHandlers.CToString(cbmHdr.name, Encoding);
|
||||
metadata.VolumeSerial = $"{cbmHdr.diskId}";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -166,8 +167,8 @@ public sealed partial class CBM
|
||||
sbInformation.AppendFormat(Localization.Disk_name_0, StringHandlers.CToString(cbmBam.name, Encoding)).
|
||||
AppendLine();
|
||||
|
||||
Metadata.VolumeName = StringHandlers.CToString(cbmBam.name, Encoding);
|
||||
Metadata.VolumeSerial = $"{cbmBam.diskId}";
|
||||
metadata.VolumeName = StringHandlers.CToString(cbmBam.name, Encoding);
|
||||
metadata.VolumeSerial = $"{cbmBam.diskId}";
|
||||
}
|
||||
|
||||
information = sbInformation.ToString();
|
||||
|
||||
@@ -81,11 +81,11 @@ public sealed partial class CPM : IReadOnlyFilesystem
|
||||
/// <summary>If <see cref="Identify" /> thinks this is a CP/M filesystem, this is the definition for it</summary>
|
||||
CpmDefinition _workingDefinition;
|
||||
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public string Name => Localization.CPM_Name;
|
||||
/// <inheritdoc />
|
||||
public Guid Id => new("AA2B8585-41DF-4E3B-8A35-D1A935E2F8A1");
|
||||
|
||||
@@ -1138,10 +1138,12 @@ public sealed partial class CPM
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("IBM437");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
// As the identification is so complex, just call Identify() and relay on its findings
|
||||
if(!Identify(imagePlugin, partition) ||
|
||||
@@ -1237,27 +1239,27 @@ public sealed partial class CPM
|
||||
sb.AppendFormat(Localization.Volume_updated_on_0, DateHandlers.CpmToDateTime(_labelUpdateDate)).
|
||||
AppendLine();
|
||||
|
||||
Metadata = new FileSystem();
|
||||
Metadata.Bootable |= _workingDefinition.sofs > 0 || _workingDefinition.ofs > 0;
|
||||
Metadata.ClusterSize = (uint)(128 << _dpb.bsh);
|
||||
metadata = new FileSystem();
|
||||
metadata.Bootable |= _workingDefinition.sofs > 0 || _workingDefinition.ofs > 0;
|
||||
metadata.ClusterSize = (uint)(128 << _dpb.bsh);
|
||||
|
||||
if(_dpb.dsm > 0)
|
||||
Metadata.Clusters = _dpb.dsm;
|
||||
metadata.Clusters = _dpb.dsm;
|
||||
else
|
||||
Metadata.Clusters = partition.End - partition.Start;
|
||||
metadata.Clusters = partition.End - partition.Start;
|
||||
|
||||
if(_labelCreationDate != null)
|
||||
{
|
||||
Metadata.CreationDate = DateHandlers.CpmToDateTime(_labelCreationDate);
|
||||
metadata.CreationDate = DateHandlers.CpmToDateTime(_labelCreationDate);
|
||||
}
|
||||
|
||||
if(_labelUpdateDate != null)
|
||||
{
|
||||
Metadata.ModificationDate = DateHandlers.CpmToDateTime(_labelUpdateDate);
|
||||
metadata.ModificationDate = DateHandlers.CpmToDateTime(_labelUpdateDate);
|
||||
}
|
||||
|
||||
Metadata.Type = FS_TYPE;
|
||||
Metadata.VolumeName = _label;
|
||||
metadata.Type = FS_TYPE;
|
||||
metadata.VolumeName = _label;
|
||||
|
||||
information = sb.ToString();
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -41,8 +40,6 @@ namespace Aaru.Filesystems;
|
||||
[SuppressMessage("ReSharper", "UnusedType.Local")]
|
||||
public sealed partial class Cram : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -61,11 +61,13 @@ public sealed partial class Cram
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
|
||||
information = "";
|
||||
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, out byte[] sector);
|
||||
metadata = new FileSystem();
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
return;
|
||||
@@ -103,7 +105,7 @@ public sealed partial class Cram
|
||||
|
||||
information = sbInformation.ToString();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
VolumeName = StringHandlers.CToString(crSb.name, Encoding),
|
||||
Type = FS_TYPE,
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -48,7 +47,5 @@ public sealed partial class ECMA67 : IFilesystem
|
||||
/// <inheritdoc />
|
||||
public Guid Id => new("62A2D44A-CBC1-4377-B4B6-28C5C92034A1");
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public string Author => Authors.NataliaPortillo;
|
||||
}
|
||||
@@ -67,10 +67,12 @@ public sealed partial class ECMA67
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-1");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
ErrorNumber errno = imagePlugin.ReadSector(6, out byte[] sector);
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
@@ -87,7 +89,7 @@ public sealed partial class ECMA67
|
||||
|
||||
sbInformation.AppendFormat(Localization.Volume_owner_0, Encoding.ASCII.GetString(vol.owner)).AppendLine();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
ClusterSize = 256,
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -37,8 +36,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements identification for the SGI Extent FileSystem</summary>
|
||||
public sealed partial class EFS : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -103,10 +103,12 @@ public sealed partial class EFS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
if(imagePlugin.Info.SectorSize < 512)
|
||||
return;
|
||||
@@ -200,7 +202,7 @@ public sealed partial class EFS
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
ClusterSize = 512,
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -39,8 +38,6 @@ namespace Aaru.Filesystems;
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Local")]
|
||||
public sealed partial class F2FS : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -74,10 +74,12 @@ public sealed partial class F2FS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = Encoding.Unicode;
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
if(imagePlugin.Info.SectorSize is < F2FS_MIN_SECTOR or > F2FS_MAX_SECTOR)
|
||||
return;
|
||||
@@ -135,7 +137,7 @@ public sealed partial class F2FS
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
SystemIdentifier = Encoding.ASCII.GetString(f2fsSb.version),
|
||||
|
||||
@@ -63,11 +63,11 @@ public sealed partial class FAT : IReadOnlyFilesystem
|
||||
FileSystemInfo _statfs;
|
||||
bool _useFirstFat;
|
||||
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public string Name => Localization.FAT_Name;
|
||||
/// <inheritdoc />
|
||||
public Guid Id => new("33513B2C-0D26-0D2D-32C3-79D8611158E0");
|
||||
|
||||
@@ -421,13 +421,14 @@ public sealed partial class FAT
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("IBM437");
|
||||
information = "";
|
||||
|
||||
var sb = new StringBuilder();
|
||||
Metadata = new FileSystem();
|
||||
metadata = new FileSystem();
|
||||
|
||||
uint sectorsPerBpb = imagePlugin.Info.SectorSize < 512 ? 512 / imagePlugin.Info.SectorSize : 1;
|
||||
|
||||
@@ -446,7 +447,7 @@ public sealed partial class FAT
|
||||
ulong rootDirectorySector = 0;
|
||||
string extraInfo = null;
|
||||
string bootChk = null;
|
||||
Metadata.Bootable = bootable;
|
||||
metadata.Bootable = bootable;
|
||||
|
||||
// This is needed because for FAT16, GEMDOS increases bytes per sector count instead of using big_sectors field.
|
||||
uint sectorsPerRealSector;
|
||||
@@ -486,12 +487,12 @@ public sealed partial class FAT
|
||||
if(fat32Bpb.version != 0)
|
||||
{
|
||||
sb.AppendLine(Localization.FAT_Plus);
|
||||
Metadata.Type = FS_TYPE_FAT_PLUS;
|
||||
metadata.Type = FS_TYPE_FAT_PLUS;
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendLine(Localization.Microsoft_FAT32);
|
||||
Metadata.Type = FS_TYPE_FAT32;
|
||||
metadata.Type = FS_TYPE_FAT32;
|
||||
}
|
||||
|
||||
if(fat32Bpb.oem_name != null)
|
||||
@@ -500,14 +501,14 @@ public sealed partial class FAT
|
||||
fat32Bpb.oem_name[7] == 0x43)
|
||||
sb.AppendLine(Localization.Volume_has_been_modified_by_Windows_9x_Me_Volume_Tracker);
|
||||
else
|
||||
Metadata.SystemIdentifier = StringHandlers.CToString(fat32Bpb.oem_name);
|
||||
metadata.SystemIdentifier = StringHandlers.CToString(fat32Bpb.oem_name);
|
||||
|
||||
if(!string.IsNullOrEmpty(Metadata.SystemIdentifier))
|
||||
sb.AppendFormat(Localization.OEM_name_0, Metadata.SystemIdentifier.Trim()).AppendLine();
|
||||
if(!string.IsNullOrEmpty(metadata.SystemIdentifier))
|
||||
sb.AppendFormat(Localization.OEM_name_0, metadata.SystemIdentifier.Trim()).AppendLine();
|
||||
|
||||
sb.AppendFormat(Localization._0_bytes_per_sector, fat32Bpb.bps).AppendLine();
|
||||
sb.AppendFormat(Localization._0_sectors_per_cluster, fat32Bpb.spc).AppendLine();
|
||||
Metadata.ClusterSize = (uint)(fat32Bpb.bps * fat32Bpb.spc);
|
||||
metadata.ClusterSize = (uint)(fat32Bpb.bps * fat32Bpb.spc);
|
||||
sb.AppendFormat(Localization._0_sectors_reserved_between_BPB_and_FAT, fat32Bpb.rsectors).AppendLine();
|
||||
|
||||
if(fat32Bpb is { big_sectors: 0, signature: 0x28 })
|
||||
@@ -515,24 +516,24 @@ public sealed partial class FAT
|
||||
sb.AppendFormat(Localization._0_sectors_on_volume_1_bytes, shortFat32Bpb.huge_sectors,
|
||||
shortFat32Bpb.huge_sectors * shortFat32Bpb.bps).AppendLine();
|
||||
|
||||
Metadata.Clusters = shortFat32Bpb.huge_sectors / shortFat32Bpb.spc;
|
||||
metadata.Clusters = shortFat32Bpb.huge_sectors / shortFat32Bpb.spc;
|
||||
}
|
||||
else if(fat32Bpb.sectors == 0)
|
||||
{
|
||||
sb.AppendFormat(Localization._0_sectors_on_volume_1_bytes, fat32Bpb.big_sectors,
|
||||
fat32Bpb.big_sectors * fat32Bpb.bps).AppendLine();
|
||||
|
||||
Metadata.Clusters = fat32Bpb.big_sectors / fat32Bpb.spc;
|
||||
metadata.Clusters = fat32Bpb.big_sectors / fat32Bpb.spc;
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendFormat(Localization._0_sectors_on_volume_1_bytes, fat32Bpb.sectors,
|
||||
fat32Bpb.sectors * fat32Bpb.bps).AppendLine();
|
||||
|
||||
Metadata.Clusters = (ulong)(fat32Bpb.sectors / fat32Bpb.spc);
|
||||
metadata.Clusters = (ulong)(fat32Bpb.sectors / fat32Bpb.spc);
|
||||
}
|
||||
|
||||
sb.AppendFormat(Localization._0_clusters_on_volume, Metadata.Clusters).AppendLine();
|
||||
sb.AppendFormat(Localization._0_clusters_on_volume, metadata.Clusters).AppendLine();
|
||||
sb.AppendFormat(Localization.Media_descriptor_0, fat32Bpb.media).AppendLine();
|
||||
sb.AppendFormat(Localization._0_sectors_per_FAT, fat32Bpb.big_spfat).AppendLine();
|
||||
sb.AppendFormat(Localization._0_sectors_per_track, fat32Bpb.sptrk).AppendLine();
|
||||
@@ -546,14 +547,14 @@ public sealed partial class FAT
|
||||
|
||||
sb.AppendFormat(Localization.Drive_number_0, fat32Bpb.drive_no).AppendLine();
|
||||
sb.AppendFormat(Localization.Volume_Serial_Number_0, fat32Bpb.serial_no).AppendLine();
|
||||
Metadata.VolumeSerial = $"{fat32Bpb.serial_no:X8}";
|
||||
metadata.VolumeSerial = $"{fat32Bpb.serial_no:X8}";
|
||||
|
||||
if((fat32Bpb.flags & 0xF8) == 0x00)
|
||||
{
|
||||
if((fat32Bpb.flags & 0x01) == 0x01)
|
||||
{
|
||||
sb.AppendLine(Localization.Volume_should_be_checked_on_next_mount);
|
||||
Metadata.Dirty = true;
|
||||
metadata.Dirty = true;
|
||||
}
|
||||
|
||||
if((fat32Bpb.flags & 0x02) == 0x02)
|
||||
@@ -573,8 +574,8 @@ public sealed partial class FAT
|
||||
|
||||
if(fat32Bpb.signature == 0x29)
|
||||
{
|
||||
Metadata.VolumeName = StringHandlers.SpacePaddedToString(fat32Bpb.volume_label, Encoding);
|
||||
Metadata.VolumeName = Metadata.VolumeName?.Replace("\0", "");
|
||||
metadata.VolumeName = StringHandlers.SpacePaddedToString(fat32Bpb.volume_label, Encoding);
|
||||
metadata.VolumeName = metadata.VolumeName?.Replace("\0", "");
|
||||
|
||||
sb.AppendFormat(Localization.Filesystem_type_0, Encoding.ASCII.GetString(fat32Bpb.fs_type)).
|
||||
AppendLine();
|
||||
@@ -586,7 +587,7 @@ public sealed partial class FAT
|
||||
|
||||
// Check that jumps to a correct boot code position and has boot signature set.
|
||||
// This will mean that the volume will boot, even if just to say "this is not bootable change disk"......
|
||||
Metadata.Bootable =
|
||||
metadata.Bootable =
|
||||
(fat32Bpb.jump[0] == 0xEB && fat32Bpb.jump[1] >= minBootNearJump && fat32Bpb.jump[1] < 0x80) ||
|
||||
(fat32Bpb.jump[0] == 0xE9 && fat32Bpb.jump.Length >= 3 &&
|
||||
BitConverter.ToUInt16(fat32Bpb.jump, 1) >= minBootNearJump &&
|
||||
@@ -616,7 +617,7 @@ public sealed partial class FAT
|
||||
if(fsInfo.free_clusters < 0xFFFFFFFF)
|
||||
{
|
||||
sb.AppendFormat(Localization._0_free_clusters, fsInfo.free_clusters).AppendLine();
|
||||
Metadata.FreeClusters = fsInfo.free_clusters;
|
||||
metadata.FreeClusters = fsInfo.free_clusters;
|
||||
}
|
||||
|
||||
if(fsInfo.last_cluster is > 2 and < 0xFFFFFFFF)
|
||||
@@ -638,7 +639,7 @@ public sealed partial class FAT
|
||||
// TODO: Check this
|
||||
if(sum == 0x1234)
|
||||
{
|
||||
Metadata.Bootable = true;
|
||||
metadata.Bootable = true;
|
||||
var atariSb = new StringBuilder();
|
||||
|
||||
atariSb.AppendFormat(Localization.cmdload_will_be_loaded_with_value_0,
|
||||
@@ -679,7 +680,7 @@ public sealed partial class FAT
|
||||
}
|
||||
|
||||
case BpbKind.Human:
|
||||
Metadata.Bootable = true;
|
||||
metadata.Bootable = true;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -802,7 +803,7 @@ public sealed partial class FAT
|
||||
break;
|
||||
}
|
||||
|
||||
Metadata.Type = FS_TYPE_FAT12;
|
||||
metadata.Type = FS_TYPE_FAT12;
|
||||
}
|
||||
else if(isFat16)
|
||||
{
|
||||
@@ -813,7 +814,7 @@ public sealed partial class FAT
|
||||
_ => Localization.Microsoft_FAT16
|
||||
});
|
||||
|
||||
Metadata.Type = FS_TYPE_FAT16;
|
||||
metadata.Type = FS_TYPE_FAT16;
|
||||
}
|
||||
|
||||
if(bpbKind == BpbKind.Atari)
|
||||
@@ -823,13 +824,13 @@ public sealed partial class FAT
|
||||
atariBpb.serial_no[2] == 0x43)
|
||||
sb.AppendLine(Localization.Volume_has_been_modified_by_Windows_9x_Me_Volume_Tracker);
|
||||
else
|
||||
Metadata.VolumeSerial = $"{atariBpb.serial_no[0]:X2}{atariBpb.serial_no[1]:X2}{atariBpb.serial_no[2]
|
||||
metadata.VolumeSerial = $"{atariBpb.serial_no[0]:X2}{atariBpb.serial_no[1]:X2}{atariBpb.serial_no[2]
|
||||
:X2}";
|
||||
|
||||
Metadata.SystemIdentifier = StringHandlers.CToString(atariBpb.oem_name);
|
||||
metadata.SystemIdentifier = StringHandlers.CToString(atariBpb.oem_name);
|
||||
|
||||
if(string.IsNullOrEmpty(Metadata.SystemIdentifier))
|
||||
Metadata.SystemIdentifier = null;
|
||||
if(string.IsNullOrEmpty(metadata.SystemIdentifier))
|
||||
metadata.SystemIdentifier = null;
|
||||
}
|
||||
else if(fakeBpb.oem_name != null)
|
||||
{
|
||||
@@ -838,7 +839,7 @@ public sealed partial class FAT
|
||||
fakeBpb.oem_name[7] == 0x43)
|
||||
sb.AppendLine(Localization.Volume_has_been_modified_by_Windows_9x_Me_Volume_Tracker);
|
||||
else
|
||||
Metadata.SystemIdentifier = fakeBpb.oem_name[0] switch
|
||||
metadata.SystemIdentifier = fakeBpb.oem_name[0] switch
|
||||
{
|
||||
// Later versions of Windows create a DOS 3 BPB without OEM name on 8 sectors/track floppies
|
||||
// OEM ID should be ASCII, otherwise ignore it
|
||||
@@ -860,15 +861,15 @@ public sealed partial class FAT
|
||||
fakeBpb.oem_name[7] >= 0x20 &&
|
||||
fakeBpb.oem_name[7] <= 0x7F => StringHandlers.CToString(fakeBpb.oem_name, Encoding,
|
||||
start: 1),
|
||||
_ => Metadata.SystemIdentifier
|
||||
_ => metadata.SystemIdentifier
|
||||
};
|
||||
|
||||
if(fakeBpb.signature is 0x28 or 0x29)
|
||||
Metadata.VolumeSerial = $"{fakeBpb.serial_no:X8}";
|
||||
metadata.VolumeSerial = $"{fakeBpb.serial_no:X8}";
|
||||
}
|
||||
|
||||
if(Metadata.SystemIdentifier != null)
|
||||
sb.AppendFormat(Localization.OEM_name_0, Metadata.SystemIdentifier.Trim()).AppendLine();
|
||||
if(metadata.SystemIdentifier != null)
|
||||
sb.AppendFormat(Localization.OEM_name_0, metadata.SystemIdentifier.Trim()).AppendLine();
|
||||
|
||||
sb.AppendFormat(Localization._0_bytes_per_sector, fakeBpb.bps).AppendLine();
|
||||
|
||||
@@ -884,10 +885,10 @@ public sealed partial class FAT
|
||||
clusters * humanBpb.bpc / imagePlugin.Info.SectorSize, clusters * humanBpb.bpc).
|
||||
AppendLine();
|
||||
|
||||
Metadata.Clusters = clusters;
|
||||
metadata.Clusters = clusters;
|
||||
sb.AppendFormat(Localization._0_sectors_per_cluster, fakeBpb.spc).AppendLine();
|
||||
sb.AppendFormat(Localization._0_clusters_on_volume, Metadata.Clusters).AppendLine();
|
||||
Metadata.ClusterSize = (uint)(fakeBpb.bps * fakeBpb.spc);
|
||||
sb.AppendFormat(Localization._0_clusters_on_volume, metadata.Clusters).AppendLine();
|
||||
metadata.ClusterSize = (uint)(fakeBpb.bps * fakeBpb.spc);
|
||||
sb.AppendFormat(Localization._0_sectors_reserved_between_BPB_and_FAT, fakeBpb.rsectors).AppendLine();
|
||||
sb.AppendFormat(Localization._0_FATs, fakeBpb.fats_no).AppendLine();
|
||||
sb.AppendFormat(Localization._0_entries_on_root_directory, fakeBpb.root_ent).AppendLine();
|
||||
@@ -911,15 +912,15 @@ public sealed partial class FAT
|
||||
{
|
||||
sb.AppendFormat(Localization.Drive_number_0, fakeBpb.drive_no).AppendLine();
|
||||
|
||||
if(Metadata.VolumeSerial != null)
|
||||
sb.AppendFormat(Localization.Volume_Serial_Number_0, Metadata.VolumeSerial).AppendLine();
|
||||
if(metadata.VolumeSerial != null)
|
||||
sb.AppendFormat(Localization.Volume_Serial_Number_0, metadata.VolumeSerial).AppendLine();
|
||||
|
||||
if((fakeBpb.flags & 0xF8) == 0x00)
|
||||
{
|
||||
if((fakeBpb.flags & 0x01) == 0x01)
|
||||
{
|
||||
sb.AppendLine(Localization.Volume_should_be_checked_on_next_mount);
|
||||
Metadata.Dirty = true;
|
||||
metadata.Dirty = true;
|
||||
}
|
||||
|
||||
if((fakeBpb.flags & 0x02) == 0x02)
|
||||
@@ -928,28 +929,28 @@ public sealed partial class FAT
|
||||
|
||||
if(fakeBpb.signature == 0x29 || andosOemCorrect)
|
||||
{
|
||||
Metadata.VolumeName = StringHandlers.SpacePaddedToString(fakeBpb.volume_label, Encoding);
|
||||
Metadata.VolumeName = Metadata.VolumeName?.Replace("\0", "");
|
||||
metadata.VolumeName = StringHandlers.SpacePaddedToString(fakeBpb.volume_label, Encoding);
|
||||
metadata.VolumeName = metadata.VolumeName?.Replace("\0", "");
|
||||
|
||||
sb.AppendFormat(Localization.Filesystem_type_0, Encoding.ASCII.GetString(fakeBpb.fs_type)).
|
||||
AppendLine();
|
||||
}
|
||||
}
|
||||
else if(bpbKind == BpbKind.Atari &&
|
||||
Metadata.VolumeSerial != null)
|
||||
sb.AppendFormat(Localization.Volume_Serial_Number_0, Metadata.VolumeSerial).AppendLine();
|
||||
metadata.VolumeSerial != null)
|
||||
sb.AppendFormat(Localization.Volume_Serial_Number_0, metadata.VolumeSerial).AppendLine();
|
||||
|
||||
bootChk = Sha1Context.Data(fakeBpb.boot_code, out _);
|
||||
|
||||
// Workaround that PCExchange jumps into "FAT16 "...
|
||||
if(Metadata.SystemIdentifier == "PCX 2.0 ")
|
||||
if(metadata.SystemIdentifier == "PCX 2.0 ")
|
||||
fakeBpb.jump[1] += 8;
|
||||
|
||||
// Check that jumps to a correct boot code position and has boot signature set.
|
||||
// This will mean that the volume will boot, even if just to say "this is not bootable change disk"......
|
||||
if(Metadata.Bootable == false &&
|
||||
if(metadata.Bootable == false &&
|
||||
fakeBpb.jump != null)
|
||||
Metadata.Bootable |=
|
||||
metadata.Bootable |=
|
||||
(fakeBpb.jump[0] == 0xEB && fakeBpb.jump[1] >= minBootNearJump && fakeBpb.jump[1] < 0x80) ||
|
||||
(fakeBpb.jump[0] == 0xE9 && fakeBpb.jump.Length >= 3 &&
|
||||
BitConverter.ToUInt16(fakeBpb.jump, 1) >= minBootNearJump &&
|
||||
@@ -1020,22 +1021,22 @@ public sealed partial class FAT
|
||||
string volname = Encoding.GetString(fullname).Trim();
|
||||
|
||||
if(!string.IsNullOrEmpty(volname))
|
||||
Metadata.VolumeName = entry.caseinfo.HasFlag(CaseInfo.AllLowerCase) ? volname.ToLower() : volname;
|
||||
metadata.VolumeName = entry.caseinfo.HasFlag(CaseInfo.AllLowerCase) ? volname.ToLower() : volname;
|
||||
|
||||
if(entry is { ctime: > 0, cdate: > 0 })
|
||||
{
|
||||
Metadata.CreationDate = DateHandlers.DosToDateTime(entry.cdate, entry.ctime);
|
||||
metadata.CreationDate = DateHandlers.DosToDateTime(entry.cdate, entry.ctime);
|
||||
|
||||
if(entry.ctime_ms > 0)
|
||||
Metadata.CreationDate = Metadata.CreationDate?.AddMilliseconds(entry.ctime_ms * 10);
|
||||
metadata.CreationDate = metadata.CreationDate?.AddMilliseconds(entry.ctime_ms * 10);
|
||||
|
||||
sb.AppendFormat(Localization.Volume_created_on_0, Metadata.CreationDate).AppendLine();
|
||||
sb.AppendFormat(Localization.Volume_created_on_0, metadata.CreationDate).AppendLine();
|
||||
}
|
||||
|
||||
if(entry is { mtime: > 0, mdate: > 0 })
|
||||
{
|
||||
Metadata.ModificationDate = DateHandlers.DosToDateTime(entry.mdate, entry.mtime);
|
||||
sb.AppendFormat(Localization.Volume_last_modified_on_0, Metadata.ModificationDate).AppendLine();
|
||||
metadata.ModificationDate = DateHandlers.DosToDateTime(entry.mdate, entry.mtime);
|
||||
sb.AppendFormat(Localization.Volume_last_modified_on_0, metadata.ModificationDate).AppendLine();
|
||||
}
|
||||
|
||||
if(entry.adate > 0)
|
||||
@@ -1046,10 +1047,10 @@ public sealed partial class FAT
|
||||
}
|
||||
}
|
||||
|
||||
if(!string.IsNullOrEmpty(Metadata.VolumeName))
|
||||
sb.AppendFormat(Localization.Volume_label_0, Metadata.VolumeName).AppendLine();
|
||||
if(!string.IsNullOrEmpty(metadata.VolumeName))
|
||||
sb.AppendFormat(Localization.Volume_label_0, metadata.VolumeName).AppendLine();
|
||||
|
||||
if(Metadata.Bootable)
|
||||
if(metadata.Bootable)
|
||||
{
|
||||
switch(bpbSector[0])
|
||||
{
|
||||
|
||||
@@ -57,11 +57,11 @@ public sealed partial class XboxFatPlugin : IReadOnlyFilesystem
|
||||
FileSystemInfo _statfs;
|
||||
Superblock _superblock;
|
||||
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public string Name => Localization.XboxFatPlugin_Name;
|
||||
/// <inheritdoc />
|
||||
public Guid Id => new("ED27A721-4A17-4649-89FD-33633B46E228");
|
||||
|
||||
@@ -54,10 +54,12 @@ public sealed partial class XboxFatPlugin
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = Encoding.UTF8;
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
if(imagePlugin.Info.SectorSize < 512)
|
||||
return;
|
||||
@@ -103,7 +105,7 @@ public sealed partial class XboxFatPlugin
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
ClusterSize = (uint)(fatxSb.sectorsPerCluster * logicalSectorsPerPhysicalSectors *
|
||||
@@ -112,6 +114,6 @@ public sealed partial class XboxFatPlugin
|
||||
VolumeSerial = $"{fatxSb.id:X8}"
|
||||
};
|
||||
|
||||
Metadata.Clusters = (partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize / Metadata.ClusterSize;
|
||||
metadata.Clusters = (partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize / metadata.ClusterSize;
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,6 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using time_t = System.Int32;
|
||||
using ufs_daddr_t = System.Int32;
|
||||
@@ -42,8 +41,6 @@ namespace Aaru.Filesystems;
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public sealed partial class FFSPlugin : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -93,10 +93,12 @@ public sealed partial class FFSPlugin
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
var sbInformation = new StringBuilder();
|
||||
|
||||
uint magic = 0;
|
||||
@@ -152,50 +154,50 @@ public sealed partial class FFSPlugin
|
||||
return;
|
||||
}
|
||||
|
||||
Metadata = new FileSystem();
|
||||
metadata = new FileSystem();
|
||||
|
||||
switch(magic)
|
||||
{
|
||||
case UFS_MAGIC:
|
||||
sbInformation.AppendLine(Localization.UFS_filesystem);
|
||||
Metadata.Type = FS_TYPE_UFS;
|
||||
metadata.Type = FS_TYPE_UFS;
|
||||
|
||||
break;
|
||||
case UFS_CIGAM:
|
||||
sbInformation.AppendLine(Localization.Big_endian_UFS_filesystem);
|
||||
Metadata.Type = FS_TYPE_UFS;
|
||||
metadata.Type = FS_TYPE_UFS;
|
||||
|
||||
break;
|
||||
case UFS_MAGIC_BW:
|
||||
sbInformation.AppendLine(Localization.BorderWare_UFS_filesystem);
|
||||
Metadata.Type = FS_TYPE_UFS;
|
||||
metadata.Type = FS_TYPE_UFS;
|
||||
|
||||
break;
|
||||
case UFS_CIGAM_BW:
|
||||
sbInformation.AppendLine(Localization.Big_endian_BorderWare_UFS_filesystem);
|
||||
Metadata.Type = FS_TYPE_UFS;
|
||||
metadata.Type = FS_TYPE_UFS;
|
||||
|
||||
break;
|
||||
case UFS2_MAGIC:
|
||||
sbInformation.AppendLine(Localization.UFS2_filesystem);
|
||||
Metadata.Type = FS_TYPE_UFS2;
|
||||
metadata.Type = FS_TYPE_UFS2;
|
||||
|
||||
break;
|
||||
case UFS2_CIGAM:
|
||||
sbInformation.AppendLine(Localization.Big_endian_UFS2_filesystem);
|
||||
Metadata.Type = FS_TYPE_UFS2;
|
||||
metadata.Type = FS_TYPE_UFS2;
|
||||
|
||||
break;
|
||||
case UFS_BAD_MAGIC:
|
||||
sbInformation.AppendLine(Localization.Incompletely_initialized_UFS_filesystem);
|
||||
sbInformation.AppendLine(Localization.BEWARE_Following_information_may_be_completely_wrong);
|
||||
Metadata.Type = FS_TYPE_UFS;
|
||||
metadata.Type = FS_TYPE_UFS;
|
||||
|
||||
break;
|
||||
case UFS_BAD_CIGAM:
|
||||
sbInformation.AppendLine(Localization.Incompletely_initialized_big_endian_UFS_filesystem);
|
||||
sbInformation.AppendLine(Localization.BEWARE_Following_information_may_be_completely_wrong);
|
||||
Metadata.Type = FS_TYPE_UFS;
|
||||
metadata.Type = FS_TYPE_UFS;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -359,13 +361,13 @@ public sealed partial class FFSPlugin
|
||||
sbInformation.AppendFormat(Localization.Volume_last_written_on_0, DateHandlers.UnixToDateTime(sb.fs_old_time)).
|
||||
AppendLine();
|
||||
|
||||
Metadata.ModificationDate = DateHandlers.UnixToDateTime(sb.fs_old_time);
|
||||
metadata.ModificationDate = DateHandlers.UnixToDateTime(sb.fs_old_time);
|
||||
|
||||
sbInformation.AppendFormat(Localization._0_blocks_in_volume_1_bytes, sb.fs_old_size,
|
||||
(long)sb.fs_old_size * sb.fs_fsize).AppendLine();
|
||||
|
||||
Metadata.Clusters = (ulong)sb.fs_old_size;
|
||||
Metadata.ClusterSize = (uint)sb.fs_fsize;
|
||||
metadata.Clusters = (ulong)sb.fs_old_size;
|
||||
metadata.ClusterSize = (uint)sb.fs_fsize;
|
||||
|
||||
sbInformation.AppendFormat(Localization._0_data_blocks_in_volume_1_bytes, sb.fs_old_dsize,
|
||||
(long)sb.fs_old_dsize * sb.fs_fsize).AppendLine();
|
||||
@@ -445,14 +447,14 @@ public sealed partial class FFSPlugin
|
||||
sbInformation.AppendFormat(Localization._0_free_blocks_1_bytes, sb.fs_old_cstotal.cs_nbfree,
|
||||
(long)sb.fs_old_cstotal.cs_nbfree * sb.fs_fsize).AppendLine();
|
||||
|
||||
Metadata.FreeClusters = (ulong)sb.fs_old_cstotal.cs_nbfree;
|
||||
metadata.FreeClusters = (ulong)sb.fs_old_cstotal.cs_nbfree;
|
||||
sbInformation.AppendFormat(Localization._0_free_inodes, sb.fs_old_cstotal.cs_nifree).AppendLine();
|
||||
sbInformation.AppendFormat(Localization._0_free_frags, sb.fs_old_cstotal.cs_nffree).AppendLine();
|
||||
|
||||
if(sb.fs_fmod == 1)
|
||||
{
|
||||
sbInformation.AppendLine(Localization.Superblock_is_under_modification);
|
||||
Metadata.Dirty = true;
|
||||
metadata.Dirty = true;
|
||||
}
|
||||
|
||||
if(sb.fs_clean == 1)
|
||||
@@ -474,7 +476,7 @@ public sealed partial class FFSPlugin
|
||||
sbInformation.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(sb.fs_volname)).
|
||||
AppendLine();
|
||||
|
||||
Metadata.VolumeName = StringHandlers.CToString(sb.fs_volname);
|
||||
metadata.VolumeName = StringHandlers.CToString(sb.fs_volname);
|
||||
sbInformation.AppendFormat(Localization.Volume_ID_0_X16, sb.fs_swuid).AppendLine();
|
||||
|
||||
//xmlFSType.VolumeSerial = string.Format("{0:X16}", sb.fs_swuid);
|
||||
@@ -489,7 +491,7 @@ public sealed partial class FFSPlugin
|
||||
sbInformation.AppendFormat(Localization._0_free_blocks_1_bytes, sb.fs_cstotal.cs_nbfree,
|
||||
sb.fs_cstotal.cs_nbfree * sb.fs_fsize).AppendLine();
|
||||
|
||||
Metadata.FreeClusters = (ulong)sb.fs_cstotal.cs_nbfree;
|
||||
metadata.FreeClusters = (ulong)sb.fs_cstotal.cs_nbfree;
|
||||
sbInformation.AppendFormat(Localization._0_free_inodes, sb.fs_cstotal.cs_nifree).AppendLine();
|
||||
sbInformation.AppendFormat(Localization._0_free_frags, sb.fs_cstotal.cs_nffree).AppendLine();
|
||||
sbInformation.AppendFormat(Localization._0_free_clusters, sb.fs_cstotal.cs_numclusters).AppendLine();
|
||||
@@ -497,12 +499,12 @@ public sealed partial class FFSPlugin
|
||||
sbInformation.AppendFormat(Localization.Volume_last_written_on_0, DateHandlers.UnixToDateTime(sb.fs_time)).
|
||||
AppendLine();
|
||||
|
||||
Metadata.ModificationDate = DateHandlers.UnixToDateTime(sb.fs_time);
|
||||
metadata.ModificationDate = DateHandlers.UnixToDateTime(sb.fs_time);
|
||||
|
||||
sbInformation.AppendFormat(Localization._0_blocks_1_bytes, sb.fs_size, sb.fs_size * sb.fs_fsize).
|
||||
AppendLine();
|
||||
|
||||
Metadata.Clusters = (ulong)sb.fs_size;
|
||||
metadata.Clusters = (ulong)sb.fs_size;
|
||||
|
||||
sbInformation.AppendFormat(Localization._0_data_blocks_1_bytes, sb.fs_dsize, sb.fs_dsize * sb.fs_fsize).
|
||||
AppendLine();
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -37,8 +36,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection for the Plan-9 Fossil on-disk filesystem</summary>
|
||||
public sealed partial class Fossil : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -61,11 +61,13 @@ public sealed partial class Fossil
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
// Technically everything on Plan 9 from Bell Labs is in UTF-8
|
||||
Encoding = Encoding.UTF8;
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
if(imagePlugin.Info.SectorSize < 512)
|
||||
return;
|
||||
@@ -93,7 +95,7 @@ public sealed partial class Fossil
|
||||
|
||||
ulong sbLocation = (hdr.super * (hdr.blockSize / imagePlugin.Info.SectorSize)) + partition.Start;
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
ClusterSize = hdr.blockSize,
|
||||
@@ -116,7 +118,7 @@ public sealed partial class Fossil
|
||||
sb.AppendFormat(Localization.Next_root_block_0, fsb.next).AppendLine();
|
||||
sb.AppendFormat(Localization.Current_root_block_0, fsb.current).AppendLine();
|
||||
sb.AppendFormat(Localization.Volume_label_0, StringHandlers.CToString(fsb.name, Encoding)).AppendLine();
|
||||
Metadata.VolumeName = StringHandlers.CToString(fsb.name, Encoding);
|
||||
metadata.VolumeName = StringHandlers.CToString(fsb.name, Encoding);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using hammer_crc_t = System.UInt32;
|
||||
using hammer_off_t = System.UInt64;
|
||||
@@ -42,8 +41,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection for the HAMMER filesystem</summary>
|
||||
public sealed partial class HAMMER : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -67,10 +67,12 @@ public sealed partial class HAMMER
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
@@ -107,7 +109,7 @@ public sealed partial class HAMMER
|
||||
sb.AppendFormat(Localization.First_volume_buffer_starts_at_0, superBlock.vol_buf_beg).AppendLine();
|
||||
sb.AppendFormat(Localization.Volume_ends_at_0, superBlock.vol_buf_end).AppendLine();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Clusters = partition.Size / HAMMER_BIGBLOCK_SIZE,
|
||||
ClusterSize = HAMMER_BIGBLOCK_SIZE,
|
||||
@@ -127,9 +129,9 @@ public sealed partial class HAMMER
|
||||
|
||||
sb.AppendFormat(Localization.Filesystem_has_0_inodes_used, superBlock.vol0_stat_inodes).AppendLine();
|
||||
|
||||
Metadata.Clusters = (ulong)superBlock.vol0_stat_bigblocks;
|
||||
Metadata.FreeClusters = (ulong)superBlock.vol0_stat_freebigblocks;
|
||||
Metadata.Files = (ulong)superBlock.vol0_stat_inodes;
|
||||
metadata.Clusters = (ulong)superBlock.vol0_stat_bigblocks;
|
||||
metadata.FreeClusters = (ulong)superBlock.vol0_stat_freebigblocks;
|
||||
metadata.Files = (ulong)superBlock.vol0_stat_inodes;
|
||||
}
|
||||
|
||||
// 0 ?
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -42,8 +41,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of IBM's High Performance File System (HPFS)</summary>
|
||||
public sealed partial class HPFS : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -66,10 +66,12 @@ public sealed partial class HPFS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("ibm850");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
@@ -223,7 +225,7 @@ public sealed partial class HPFS
|
||||
if((sp.flags2 & 0x80) == 0x80)
|
||||
sb.AppendLine(Localization.Unknown_flag_0x80_on_flags2_is_active);
|
||||
|
||||
Metadata = new FileSystem();
|
||||
metadata = new FileSystem();
|
||||
|
||||
// Theoretically everything from BPB to SB is boot code, should I hash everything or only the sector loaded by BIOS itself?
|
||||
if(bpb.jump[0] == 0xEB &&
|
||||
@@ -231,19 +233,19 @@ public sealed partial class HPFS
|
||||
bpb.jump[1] < 0x80 &&
|
||||
bpb.signature2 == 0xAA55)
|
||||
{
|
||||
Metadata.Bootable = true;
|
||||
metadata.Bootable = true;
|
||||
string bootChk = Sha1Context.Data(bpb.boot_code, out byte[] _);
|
||||
sb.AppendLine(Localization.Volume_is_bootable);
|
||||
sb.AppendFormat(Localization.Boot_code_SHA1_0, bootChk).AppendLine();
|
||||
}
|
||||
|
||||
Metadata.Dirty |= (sp.flags1 & 0x01) == 0x01;
|
||||
Metadata.Clusters = hpfsSb.sectors;
|
||||
Metadata.ClusterSize = bpb.bps;
|
||||
Metadata.Type = FS_TYPE;
|
||||
Metadata.VolumeName = StringHandlers.CToString(bpb.volume_label, Encoding);
|
||||
Metadata.VolumeSerial = $"{bpb.serial_no:X8}";
|
||||
Metadata.SystemIdentifier = StringHandlers.CToString(bpb.oem_name);
|
||||
metadata.Dirty |= (sp.flags1 & 0x01) == 0x01;
|
||||
metadata.Clusters = hpfsSb.sectors;
|
||||
metadata.ClusterSize = bpb.bps;
|
||||
metadata.Type = FS_TYPE;
|
||||
metadata.VolumeName = StringHandlers.CToString(bpb.volume_label, Encoding);
|
||||
metadata.VolumeSerial = $"{bpb.serial_no:X8}";
|
||||
metadata.SystemIdentifier = StringHandlers.CToString(bpb.oem_name);
|
||||
|
||||
information = sb.ToString();
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -39,8 +38,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements identification of IBM's High Performance Optical File System</summary>
|
||||
public sealed partial class HPOFS : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -66,10 +66,12 @@ public sealed partial class HPOFS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("ibm850");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
@@ -212,7 +214,7 @@ public sealed partial class HPOFS
|
||||
sb.AppendFormat(Localization.Filesystem_version_0_1, mib.major, mib.minor).AppendLine();
|
||||
sb.AppendFormat(Localization.Volume_can_be_filled_up_to_0, vib.percentFull).AppendLine();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Clusters = mib.sectors / bpb.spc,
|
||||
ClusterSize = (uint)(bpb.bps * bpb.spc),
|
||||
|
||||
@@ -58,11 +58,11 @@ public sealed partial class ISO9660 : IReadOnlyFilesystem
|
||||
bool _useTransTbl;
|
||||
ushort _blockSize;
|
||||
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public string Name => "ISO9660 Filesystem";
|
||||
/// <inheritdoc />
|
||||
public Guid Id => new("d812f4d3-c357-400d-90fd-3b22ef786aa8");
|
||||
|
||||
@@ -84,10 +84,12 @@ public sealed partial class ISO9660
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.ASCII;
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
var isoMetadata = new StringBuilder();
|
||||
byte[] vdMagic = new byte[5]; // Volume Descriptor magic "CD001"
|
||||
byte[] hsMagic = new byte[5]; // Volume Descriptor magic "CDROM"
|
||||
@@ -237,7 +239,7 @@ public sealed partial class ISO9660
|
||||
DecodedVolumeDescriptor decodedVd;
|
||||
var decodedJolietVd = new DecodedVolumeDescriptor();
|
||||
|
||||
Metadata = new FileSystem();
|
||||
metadata = new FileSystem();
|
||||
|
||||
if(pvd == null &&
|
||||
hsvd == null &&
|
||||
@@ -910,97 +912,97 @@ public sealed partial class ISO9660
|
||||
isoMetadata.Append(suspInformation);
|
||||
|
||||
if(highSierraInfo)
|
||||
Metadata.Type = FS_TYPE_HSF;
|
||||
metadata.Type = FS_TYPE_HSF;
|
||||
else if(cdiInfo)
|
||||
Metadata.Type = FS_TYPE_CDI;
|
||||
metadata.Type = FS_TYPE_CDI;
|
||||
else
|
||||
Metadata.Type = FS_TYPE_ISO;
|
||||
metadata.Type = FS_TYPE_ISO;
|
||||
|
||||
if(jolietvd != null)
|
||||
{
|
||||
Metadata.VolumeName = decodedJolietVd.VolumeIdentifier;
|
||||
metadata.VolumeName = decodedJolietVd.VolumeIdentifier;
|
||||
|
||||
if(string.IsNullOrEmpty(decodedJolietVd.SystemIdentifier) ||
|
||||
decodedVd.SystemIdentifier.Length > decodedJolietVd.SystemIdentifier.Length)
|
||||
Metadata.SystemIdentifier = decodedVd.SystemIdentifier;
|
||||
metadata.SystemIdentifier = decodedVd.SystemIdentifier;
|
||||
else
|
||||
Metadata.SystemIdentifier = string.IsNullOrEmpty(decodedJolietVd.SystemIdentifier) ? null
|
||||
metadata.SystemIdentifier = string.IsNullOrEmpty(decodedJolietVd.SystemIdentifier) ? null
|
||||
: decodedJolietVd.SystemIdentifier;
|
||||
|
||||
if(string.IsNullOrEmpty(decodedJolietVd.VolumeSetIdentifier) ||
|
||||
decodedVd.VolumeSetIdentifier.Length > decodedJolietVd.VolumeSetIdentifier.Length)
|
||||
Metadata.VolumeSetIdentifier = decodedVd.VolumeSetIdentifier;
|
||||
metadata.VolumeSetIdentifier = decodedVd.VolumeSetIdentifier;
|
||||
else
|
||||
Metadata.VolumeSetIdentifier = string.IsNullOrEmpty(decodedJolietVd.VolumeSetIdentifier) ? null
|
||||
metadata.VolumeSetIdentifier = string.IsNullOrEmpty(decodedJolietVd.VolumeSetIdentifier) ? null
|
||||
: decodedJolietVd.VolumeSetIdentifier;
|
||||
|
||||
if(string.IsNullOrEmpty(decodedJolietVd.PublisherIdentifier) ||
|
||||
decodedVd.PublisherIdentifier.Length > decodedJolietVd.PublisherIdentifier.Length)
|
||||
Metadata.PublisherIdentifier = decodedVd.PublisherIdentifier;
|
||||
metadata.PublisherIdentifier = decodedVd.PublisherIdentifier;
|
||||
else
|
||||
Metadata.PublisherIdentifier = string.IsNullOrEmpty(decodedJolietVd.PublisherIdentifier) ? null
|
||||
metadata.PublisherIdentifier = string.IsNullOrEmpty(decodedJolietVd.PublisherIdentifier) ? null
|
||||
: decodedJolietVd.PublisherIdentifier;
|
||||
|
||||
if(string.IsNullOrEmpty(decodedJolietVd.DataPreparerIdentifier) ||
|
||||
decodedVd.DataPreparerIdentifier.Length > decodedJolietVd.DataPreparerIdentifier.Length)
|
||||
Metadata.DataPreparerIdentifier = decodedVd.DataPreparerIdentifier;
|
||||
metadata.DataPreparerIdentifier = decodedVd.DataPreparerIdentifier;
|
||||
else
|
||||
Metadata.DataPreparerIdentifier = string.IsNullOrEmpty(decodedJolietVd.DataPreparerIdentifier) ? null
|
||||
metadata.DataPreparerIdentifier = string.IsNullOrEmpty(decodedJolietVd.DataPreparerIdentifier) ? null
|
||||
: decodedJolietVd.DataPreparerIdentifier;
|
||||
|
||||
if(string.IsNullOrEmpty(decodedJolietVd.ApplicationIdentifier) ||
|
||||
decodedVd.ApplicationIdentifier.Length > decodedJolietVd.ApplicationIdentifier.Length)
|
||||
Metadata.ApplicationIdentifier = decodedVd.ApplicationIdentifier;
|
||||
metadata.ApplicationIdentifier = decodedVd.ApplicationIdentifier;
|
||||
else
|
||||
Metadata.ApplicationIdentifier = string.IsNullOrEmpty(decodedJolietVd.ApplicationIdentifier) ? null
|
||||
metadata.ApplicationIdentifier = string.IsNullOrEmpty(decodedJolietVd.ApplicationIdentifier) ? null
|
||||
: decodedJolietVd.ApplicationIdentifier;
|
||||
|
||||
Metadata.CreationDate = decodedJolietVd.CreationTime;
|
||||
metadata.CreationDate = decodedJolietVd.CreationTime;
|
||||
|
||||
if(decodedJolietVd.HasModificationTime)
|
||||
{
|
||||
Metadata.ModificationDate = decodedJolietVd.ModificationTime;
|
||||
metadata.ModificationDate = decodedJolietVd.ModificationTime;
|
||||
}
|
||||
|
||||
if(decodedJolietVd.HasExpirationTime)
|
||||
{
|
||||
Metadata.ExpirationDate = decodedJolietVd.ExpirationTime;
|
||||
metadata.ExpirationDate = decodedJolietVd.ExpirationTime;
|
||||
}
|
||||
|
||||
if(decodedJolietVd.HasEffectiveTime)
|
||||
{
|
||||
Metadata.EffectiveDate = decodedJolietVd.EffectiveTime;
|
||||
metadata.EffectiveDate = decodedJolietVd.EffectiveTime;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Metadata.SystemIdentifier = decodedVd.SystemIdentifier;
|
||||
Metadata.VolumeName = decodedVd.VolumeIdentifier;
|
||||
Metadata.VolumeSetIdentifier = decodedVd.VolumeSetIdentifier;
|
||||
Metadata.PublisherIdentifier = decodedVd.PublisherIdentifier;
|
||||
Metadata.DataPreparerIdentifier = decodedVd.DataPreparerIdentifier;
|
||||
Metadata.ApplicationIdentifier = decodedVd.ApplicationIdentifier;
|
||||
Metadata.CreationDate = decodedVd.CreationTime;
|
||||
metadata.SystemIdentifier = decodedVd.SystemIdentifier;
|
||||
metadata.VolumeName = decodedVd.VolumeIdentifier;
|
||||
metadata.VolumeSetIdentifier = decodedVd.VolumeSetIdentifier;
|
||||
metadata.PublisherIdentifier = decodedVd.PublisherIdentifier;
|
||||
metadata.DataPreparerIdentifier = decodedVd.DataPreparerIdentifier;
|
||||
metadata.ApplicationIdentifier = decodedVd.ApplicationIdentifier;
|
||||
metadata.CreationDate = decodedVd.CreationTime;
|
||||
|
||||
if(decodedVd.HasModificationTime)
|
||||
{
|
||||
Metadata.ModificationDate = decodedVd.ModificationTime;
|
||||
metadata.ModificationDate = decodedVd.ModificationTime;
|
||||
}
|
||||
|
||||
if(decodedVd.HasExpirationTime)
|
||||
{
|
||||
Metadata.ExpirationDate = decodedVd.ExpirationTime;
|
||||
metadata.ExpirationDate = decodedVd.ExpirationTime;
|
||||
}
|
||||
|
||||
if(decodedVd.HasEffectiveTime)
|
||||
{
|
||||
Metadata.EffectiveDate = decodedVd.EffectiveTime;
|
||||
metadata.EffectiveDate = decodedVd.EffectiveTime;
|
||||
}
|
||||
}
|
||||
|
||||
Metadata.Bootable |= bvd != null || segaCd != null || saturn != null || dreamcast != null;
|
||||
Metadata.Clusters = decodedVd.Blocks;
|
||||
Metadata.ClusterSize = decodedVd.BlockSize;
|
||||
metadata.Bootable |= bvd != null || segaCd != null || saturn != null || dreamcast != null;
|
||||
metadata.Clusters = decodedVd.Blocks;
|
||||
metadata.ClusterSize = decodedVd.BlockSize;
|
||||
|
||||
information = isoMetadata.ToString();
|
||||
}
|
||||
|
||||
@@ -63,10 +63,12 @@ public sealed partial class JFS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
var sb = new StringBuilder();
|
||||
uint bootSectors = JFS_BOOT_BLOCKS_SIZE / imagePlugin.Info.SectorSize;
|
||||
ErrorNumber errno = imagePlugin.ReadSector(partition.Start + bootSectors, out byte[] sector);
|
||||
@@ -166,7 +168,7 @@ public sealed partial class JFS
|
||||
|
||||
sb.AppendFormat(Localization.Volume_UUID_0, jfsSb.s_uuid).AppendLine();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
Clusters = jfsSb.s_size,
|
||||
@@ -178,7 +180,7 @@ public sealed partial class JFS
|
||||
};
|
||||
|
||||
if(jfsSb.s_state != 0)
|
||||
Metadata.Dirty = true;
|
||||
metadata.Dirty = true;
|
||||
|
||||
information = sb.ToString();
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -39,8 +38,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of IBM's Journaled File System</summary>
|
||||
public sealed partial class JFS : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -59,10 +59,12 @@ public sealed partial class LIF
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
if(imagePlugin.Info.SectorSize < 256)
|
||||
return;
|
||||
@@ -94,7 +96,7 @@ public sealed partial class LIF
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
ClusterSize = 256,
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -38,8 +37,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of the LIF filesystem</summary>
|
||||
public sealed partial class LIF : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -126,10 +126,12 @@ public sealed partial class LisaFS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = new LisaRoman();
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
var sb = new StringBuilder();
|
||||
|
||||
if(imagePlugin.Info.ReadableSectorTags?.Contains(SectorTagType.AppleSectorTag) != true)
|
||||
@@ -378,27 +380,27 @@ public sealed partial class LisaFS
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
Metadata = new FileSystem();
|
||||
metadata = new FileSystem();
|
||||
|
||||
if(DateTime.Compare(infoMddf.dtvb, DateHandlers.LisaToDateTime(0)) > 0)
|
||||
{
|
||||
Metadata.BackupDate = infoMddf.dtvb;
|
||||
metadata.BackupDate = infoMddf.dtvb;
|
||||
}
|
||||
|
||||
Metadata.Clusters = infoMddf.vol_size;
|
||||
Metadata.ClusterSize = (uint)(infoMddf.clustersize * infoMddf.datasize);
|
||||
metadata.Clusters = infoMddf.vol_size;
|
||||
metadata.ClusterSize = (uint)(infoMddf.clustersize * infoMddf.datasize);
|
||||
|
||||
if(DateTime.Compare(infoMddf.dtvc, DateHandlers.LisaToDateTime(0)) > 0)
|
||||
{
|
||||
Metadata.CreationDate = infoMddf.dtvc;
|
||||
metadata.CreationDate = infoMddf.dtvc;
|
||||
}
|
||||
|
||||
Metadata.Dirty = infoMddf.vol_left_mounted != 0;
|
||||
Metadata.Files = infoMddf.filecount;
|
||||
Metadata.FreeClusters = infoMddf.freecount;
|
||||
Metadata.Type = FS_TYPE;
|
||||
Metadata.VolumeName = infoMddf.volname;
|
||||
Metadata.VolumeSerial = $"{infoMddf.volid:X16}";
|
||||
metadata.Dirty = infoMddf.vol_left_mounted != 0;
|
||||
metadata.Files = infoMddf.filecount;
|
||||
metadata.FreeClusters = infoMddf.freecount;
|
||||
metadata.Type = FS_TYPE;
|
||||
metadata.VolumeName = infoMddf.volname;
|
||||
metadata.VolumeSerial = $"{infoMddf.volid:X16}";
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -51,12 +51,12 @@ public sealed partial class LisaFS : IReadOnlyFilesystem
|
||||
/// <inheritdoc />
|
||||
public string Name => "Apple Lisa File System";
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Guid Id => new("7E6034D1-D823-4248-A54D-239742B28391");
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public string Author => Authors.NataliaPortillo;
|
||||
|
||||
// TODO: Implement Lisa 7/7 namespace (needs decoding {!CATALOG} file)
|
||||
|
||||
@@ -100,10 +100,12 @@ public sealed partial class Locus
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
if(imagePlugin.Info.SectorSize < 512)
|
||||
return;
|
||||
@@ -238,7 +240,7 @@ public sealed partial class Locus
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
ClusterSize = (uint)blockSize,
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using commitcnt_t = System.Int32;
|
||||
|
||||
@@ -61,8 +60,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of the Locus filesystem</summary>
|
||||
public sealed partial class Locus : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -65,10 +65,12 @@ public sealed partial class MicroDOS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("koi8-r");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
@@ -88,7 +90,7 @@ public sealed partial class MicroDOS
|
||||
sb.AppendFormat(Localization.Volume_contains_0_files, block0.files).AppendLine();
|
||||
sb.AppendFormat(Localization.First_used_block_is_0, block0.firstUsedBlock).AppendLine();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
ClusterSize = 512,
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -43,8 +42,6 @@ namespace Aaru.Filesystems;
|
||||
/// </summary>
|
||||
public sealed partial class MicroDOS : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -81,10 +81,12 @@ public sealed partial class MinixFS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
@@ -115,7 +117,7 @@ public sealed partial class MinixFS
|
||||
|
||||
ushort magic = BitConverter.ToUInt16(minixSbSector, 0x018);
|
||||
|
||||
Metadata = new FileSystem();
|
||||
metadata = new FileSystem();
|
||||
|
||||
bool littleEndian;
|
||||
|
||||
@@ -129,18 +131,18 @@ public sealed partial class MinixFS
|
||||
case MINIX3_MAGIC:
|
||||
case MINIX3_CIGAM:
|
||||
minixVersion = Localization.Minix_v3_filesystem;
|
||||
Metadata.Type = FS_TYPE_V3;
|
||||
metadata.Type = FS_TYPE_V3;
|
||||
|
||||
break;
|
||||
case MINIX2_MAGIC:
|
||||
case MINIX2_CIGAM:
|
||||
minixVersion = Localization.Minix_3_v2_filesystem;
|
||||
Metadata.Type = FS_TYPE_V3;
|
||||
metadata.Type = FS_TYPE_V3;
|
||||
|
||||
break;
|
||||
default:
|
||||
minixVersion = Localization.Minix_3_v1_filesystem;
|
||||
Metadata.Type = FS_TYPE_V3;
|
||||
metadata.Type = FS_TYPE_V3;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -157,56 +159,56 @@ public sealed partial class MinixFS
|
||||
filenamesize = 14;
|
||||
minixVersion = Localization.Minix_v1_filesystem;
|
||||
littleEndian = true;
|
||||
Metadata.Type = FS_TYPE_V1;
|
||||
metadata.Type = FS_TYPE_V1;
|
||||
|
||||
break;
|
||||
case MINIX_MAGIC2:
|
||||
filenamesize = 30;
|
||||
minixVersion = Localization.Minix_v1_filesystem;
|
||||
littleEndian = true;
|
||||
Metadata.Type = FS_TYPE_V1;
|
||||
metadata.Type = FS_TYPE_V1;
|
||||
|
||||
break;
|
||||
case MINIX2_MAGIC:
|
||||
filenamesize = 14;
|
||||
minixVersion = Localization.Minix_v2_filesystem;
|
||||
littleEndian = true;
|
||||
Metadata.Type = FS_TYPE_V2;
|
||||
metadata.Type = FS_TYPE_V2;
|
||||
|
||||
break;
|
||||
case MINIX2_MAGIC2:
|
||||
filenamesize = 30;
|
||||
minixVersion = Localization.Minix_v2_filesystem;
|
||||
littleEndian = true;
|
||||
Metadata.Type = FS_TYPE_V2;
|
||||
metadata.Type = FS_TYPE_V2;
|
||||
|
||||
break;
|
||||
case MINIX_CIGAM:
|
||||
filenamesize = 14;
|
||||
minixVersion = Localization.Minix_v1_filesystem;
|
||||
littleEndian = false;
|
||||
Metadata.Type = FS_TYPE_V1;
|
||||
metadata.Type = FS_TYPE_V1;
|
||||
|
||||
break;
|
||||
case MINIX_CIGAM2:
|
||||
filenamesize = 30;
|
||||
minixVersion = Localization.Minix_v1_filesystem;
|
||||
littleEndian = false;
|
||||
Metadata.Type = FS_TYPE_V1;
|
||||
metadata.Type = FS_TYPE_V1;
|
||||
|
||||
break;
|
||||
case MINIX2_CIGAM:
|
||||
filenamesize = 14;
|
||||
minixVersion = Localization.Minix_v2_filesystem;
|
||||
littleEndian = false;
|
||||
Metadata.Type = FS_TYPE_V2;
|
||||
metadata.Type = FS_TYPE_V2;
|
||||
|
||||
break;
|
||||
case MINIX2_CIGAM2:
|
||||
filenamesize = 30;
|
||||
minixVersion = Localization.Minix_v2_filesystem;
|
||||
littleEndian = false;
|
||||
Metadata.Type = FS_TYPE_V2;
|
||||
metadata.Type = FS_TYPE_V2;
|
||||
|
||||
break;
|
||||
default: return;
|
||||
@@ -247,8 +249,8 @@ public sealed partial class MinixFS
|
||||
sb.AppendFormat(Localization._0_bytes_maximum_per_file, mnxSb.s_max_size).AppendLine();
|
||||
sb.AppendFormat(Localization.On_disk_filesystem_version_0, mnxSb.s_disk_version).AppendLine();
|
||||
|
||||
Metadata.ClusterSize = mnxSb.s_blocksize;
|
||||
Metadata.Clusters = mnxSb.s_zones > 0 ? mnxSb.s_zones : mnxSb.s_nzones;
|
||||
metadata.ClusterSize = mnxSb.s_blocksize;
|
||||
metadata.Clusters = mnxSb.s_zones > 0 ? mnxSb.s_zones : mnxSb.s_nzones;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -278,8 +280,8 @@ public sealed partial class MinixFS
|
||||
//sb.AppendFormat("log2 of blocks/zone: {0}", mnx_sb.s_log_zone_size).AppendLine(); // Apparently 0
|
||||
sb.AppendFormat(Localization._0_bytes_maximum_per_file, mnxSb.s_max_size).AppendLine();
|
||||
sb.AppendFormat(Localization.Filesystem_state_0, mnxSb.s_state).AppendLine();
|
||||
Metadata.ClusterSize = 1024;
|
||||
Metadata.Clusters = mnxSb.s_zones > 0 ? mnxSb.s_zones : mnxSb.s_nzones;
|
||||
metadata.ClusterSize = 1024;
|
||||
metadata.Clusters = mnxSb.s_zones > 0 ? mnxSb.s_zones : mnxSb.s_nzones;
|
||||
}
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -38,8 +37,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of the MINIX filesystem</summary>
|
||||
public sealed partial class MinixFS : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -74,10 +74,12 @@ public sealed partial class NILFS2
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.UTF8;
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
if(imagePlugin.Info.SectorSize < 512)
|
||||
return;
|
||||
@@ -136,7 +138,7 @@ public sealed partial class NILFS2
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
ClusterSize = (uint)(1 << (int)(nilfsSb.log_block_size + 10)),
|
||||
@@ -147,8 +149,8 @@ public sealed partial class NILFS2
|
||||
};
|
||||
|
||||
if(nilfsSb.creator_os == 0)
|
||||
Metadata.SystemIdentifier = "Linux";
|
||||
metadata.SystemIdentifier = "Linux";
|
||||
|
||||
Metadata.Clusters = nilfsSb.dev_size / Metadata.ClusterSize;
|
||||
metadata.Clusters = nilfsSb.dev_size / metadata.ClusterSize;
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -39,8 +38,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of the New Implementation of a Log-structured File System v2</summary>
|
||||
public sealed partial class NILFS2 : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -75,10 +75,12 @@ public sealed partial class NTFS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = Encoding.Unicode;
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
@@ -130,23 +132,23 @@ public sealed partial class NTFS
|
||||
|
||||
// sb.AppendFormat("Signature 2: 0x{0:X4}", ntfs_bb.signature2).AppendLine();
|
||||
|
||||
Metadata = new FileSystem();
|
||||
metadata = new FileSystem();
|
||||
|
||||
if(ntfsBb.jump[0] == 0xEB &&
|
||||
ntfsBb.jump[1] > 0x4E &&
|
||||
ntfsBb.jump[1] < 0x80 &&
|
||||
ntfsBb.signature2 == 0xAA55)
|
||||
{
|
||||
Metadata.Bootable = true;
|
||||
metadata.Bootable = true;
|
||||
string bootChk = Sha1Context.Data(ntfsBb.boot_code, out _);
|
||||
sb.AppendLine(Localization.Volume_is_bootable);
|
||||
sb.AppendFormat(Localization.Boot_code_SHA1_0, bootChk).AppendLine();
|
||||
}
|
||||
|
||||
Metadata.ClusterSize = (uint)(ntfsBb.spc * ntfsBb.bps);
|
||||
Metadata.Clusters = (ulong)(ntfsBb.sectors / ntfsBb.spc);
|
||||
Metadata.VolumeSerial = $"{ntfsBb.serial_no:X16}";
|
||||
Metadata.Type = FS_TYPE;
|
||||
metadata.ClusterSize = (uint)(ntfsBb.spc * ntfsBb.bps);
|
||||
metadata.Clusters = (ulong)(ntfsBb.sectors / ntfsBb.spc);
|
||||
metadata.VolumeSerial = $"{ntfsBb.serial_no:X16}";
|
||||
metadata.Type = FS_TYPE;
|
||||
|
||||
information = sb.ToString();
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -38,8 +37,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of the New Technology File System (NTFS)</summary>
|
||||
public sealed partial class NTFS : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -62,12 +62,13 @@ public sealed partial class NintendoPlugin
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("shift_jis");
|
||||
var sbInformation = new StringBuilder();
|
||||
information = "";
|
||||
Metadata = new FileSystem();
|
||||
metadata = new FileSystem();
|
||||
|
||||
var fields = new NintendoFields();
|
||||
|
||||
@@ -324,11 +325,11 @@ public sealed partial class NintendoPlugin
|
||||
AppendLine();
|
||||
|
||||
information = sbInformation.ToString();
|
||||
Metadata.Bootable = true;
|
||||
Metadata.Clusters = imagePlugin.Info.Sectors * imagePlugin.Info.SectorSize / 2048;
|
||||
Metadata.ClusterSize = 2048;
|
||||
Metadata.Type = wii ? FS_TYPE_WII : FS_TYPE_NGC;
|
||||
Metadata.VolumeName = fields.Title;
|
||||
Metadata.VolumeSerial = fields.DiscId;
|
||||
metadata.Bootable = true;
|
||||
metadata.Clusters = imagePlugin.Info.Sectors * imagePlugin.Info.SectorSize / 2048;
|
||||
metadata.ClusterSize = 2048;
|
||||
metadata.Type = wii ? FS_TYPE_WII : FS_TYPE_NGC;
|
||||
metadata.VolumeName = fields.Title;
|
||||
metadata.VolumeSerial = fields.DiscId;
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -37,8 +36,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of the filesystem used by Nintendo Gamecube and Wii discs</summary>
|
||||
public sealed partial class NintendoPlugin : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -98,10 +98,12 @@ public sealed partial class ODS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-1");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
@@ -257,7 +259,7 @@ public sealed partial class ODS
|
||||
sb.AppendFormat(Localization.File_protection_0, homeblock.fileprot).AppendLine();
|
||||
sb.AppendFormat(Localization.Record_protection_0, homeblock.recprot).AppendLine();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
ClusterSize = (uint)(homeblock.cluster * 512),
|
||||
@@ -268,12 +270,12 @@ public sealed partial class ODS
|
||||
|
||||
if(homeblock.credate > 0)
|
||||
{
|
||||
Metadata.CreationDate = DateHandlers.VmsToDateTime(homeblock.credate);
|
||||
metadata.CreationDate = DateHandlers.VmsToDateTime(homeblock.credate);
|
||||
}
|
||||
|
||||
if(homeblock.revdate > 0)
|
||||
{
|
||||
Metadata.ModificationDate = DateHandlers.VmsToDateTime(homeblock.revdate);
|
||||
metadata.ModificationDate = DateHandlers.VmsToDateTime(homeblock.revdate);
|
||||
}
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -50,8 +49,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of DEC's On-Disk Structure, aka the ODS filesystem</summary>
|
||||
public sealed partial class ODS : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -63,12 +63,14 @@ public sealed partial class OperaFS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
// TODO: Find correct default encoding
|
||||
Encoding = Encoding.ASCII;
|
||||
information = "";
|
||||
var superBlockMetadata = new StringBuilder();
|
||||
metadata = new FileSystem();
|
||||
var superBlockmetadata = new StringBuilder();
|
||||
|
||||
ErrorNumber errno = imagePlugin.ReadSector(0 + partition.Start, out byte[] sbSector);
|
||||
|
||||
@@ -84,53 +86,53 @@ public sealed partial class OperaFS
|
||||
if(Encoding.ASCII.GetString(sb.sync_bytes) != SYNC)
|
||||
return;
|
||||
|
||||
superBlockMetadata.AppendFormat(Localization.Opera_filesystem_disc).AppendLine();
|
||||
superBlockmetadata.AppendFormat(Localization.Opera_filesystem_disc).AppendLine();
|
||||
|
||||
if(!string.IsNullOrEmpty(StringHandlers.CToString(sb.volume_label, Encoding)))
|
||||
superBlockMetadata.
|
||||
superBlockmetadata.
|
||||
AppendFormat(Localization.Volume_label_0, StringHandlers.CToString(sb.volume_label, Encoding)).
|
||||
AppendLine();
|
||||
|
||||
if(!string.IsNullOrEmpty(StringHandlers.CToString(sb.volume_comment, Encoding)))
|
||||
superBlockMetadata.
|
||||
superBlockmetadata.
|
||||
AppendFormat(Localization.Volume_comment_0, StringHandlers.CToString(sb.volume_comment, Encoding)).
|
||||
AppendLine();
|
||||
|
||||
superBlockMetadata.AppendFormat(Localization.Volume_identifier_0_X8, sb.volume_id).AppendLine();
|
||||
superBlockMetadata.AppendFormat(Localization.Block_size_0_bytes, sb.block_size).AppendLine();
|
||||
superBlockmetadata.AppendFormat(Localization.Volume_identifier_0_X8, sb.volume_id).AppendLine();
|
||||
superBlockmetadata.AppendFormat(Localization.Block_size_0_bytes, sb.block_size).AppendLine();
|
||||
|
||||
if(imagePlugin.Info.SectorSize is 2336 or 2352 or 2448)
|
||||
{
|
||||
if(sb.block_size != 2048)
|
||||
superBlockMetadata.
|
||||
superBlockmetadata.
|
||||
AppendFormat(Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_block,
|
||||
sb.block_size, 2048);
|
||||
}
|
||||
else if(imagePlugin.Info.SectorSize != sb.block_size)
|
||||
superBlockMetadata.
|
||||
superBlockmetadata.
|
||||
AppendFormat(Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_block,
|
||||
sb.block_size, imagePlugin.Info.SectorSize);
|
||||
|
||||
superBlockMetadata.
|
||||
superBlockmetadata.
|
||||
AppendFormat(Localization.Volume_size_0_blocks_1_bytes, sb.block_count, sb.block_size * sb.block_count).
|
||||
AppendLine();
|
||||
|
||||
if(sb.block_count > imagePlugin.Info.Sectors)
|
||||
superBlockMetadata.
|
||||
superBlockmetadata.
|
||||
AppendFormat(Localization.WARNING__Filesystem_indicates_0_blocks_while_device_indicates_1_blocks,
|
||||
sb.block_count, imagePlugin.Info.Sectors);
|
||||
|
||||
superBlockMetadata.AppendFormat(Localization.Root_directory_identifier_0, sb.root_dirid).AppendLine();
|
||||
superBlockMetadata.AppendFormat(Localization.Root_directory_block_size_0_bytes, sb.rootdir_bsize).AppendLine();
|
||||
superBlockmetadata.AppendFormat(Localization.Root_directory_identifier_0, sb.root_dirid).AppendLine();
|
||||
superBlockmetadata.AppendFormat(Localization.Root_directory_block_size_0_bytes, sb.rootdir_bsize).AppendLine();
|
||||
|
||||
superBlockMetadata.AppendFormat(Localization.Root_directory_size_0_blocks_1_bytes, sb.rootdir_blocks,
|
||||
superBlockmetadata.AppendFormat(Localization.Root_directory_size_0_blocks_1_bytes, sb.rootdir_blocks,
|
||||
sb.rootdir_bsize * sb.rootdir_blocks).AppendLine();
|
||||
|
||||
superBlockMetadata.AppendFormat(Localization.Last_root_directory_copy_0, sb.last_root_copy).AppendLine();
|
||||
superBlockmetadata.AppendFormat(Localization.Last_root_directory_copy_0, sb.last_root_copy).AppendLine();
|
||||
|
||||
information = superBlockMetadata.ToString();
|
||||
information = superBlockmetadata.ToString();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
VolumeName = StringHandlers.CToString(sb.volume_label, Encoding),
|
||||
|
||||
@@ -48,11 +48,11 @@ public sealed partial class OperaFS : IReadOnlyFilesystem
|
||||
FileSystemInfo _statfs;
|
||||
uint _volumeBlockSizeRatio;
|
||||
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public string Name => Localization.OperaFS_Name;
|
||||
/// <inheritdoc />
|
||||
public Guid Id => new("0ec84ec7-eae6-4196-83fe-943b3fe46dbd");
|
||||
|
||||
@@ -61,12 +61,13 @@ public sealed partial class PCEnginePlugin
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("shift_jis");
|
||||
information = "";
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
Clusters = (partition.End - partition.Start + 1) / imagePlugin.Info.SectorSize * 2048,
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -41,8 +40,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of the PC-Engine CD file headers</summary>
|
||||
public sealed partial class PCEnginePlugin : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -63,11 +63,13 @@ public sealed partial class PCFX
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
// Always Shift-JIS
|
||||
Encoding = Encoding.GetEncoding("shift_jis");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, 2, out byte[] sector);
|
||||
|
||||
@@ -112,7 +114,7 @@ public sealed partial class PCFX
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
Clusters = partition.Length,
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -42,8 +41,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of NEC PC-FX headers</summary>
|
||||
public sealed partial class PCFX : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -58,10 +58,12 @@ public sealed partial class PFS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
information = "";
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-1");
|
||||
metadata = new FileSystem();
|
||||
ErrorNumber errno = imagePlugin.ReadSector(2 + partition.Start, out byte[] rootBlockSector);
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
@@ -70,25 +72,25 @@ public sealed partial class PFS
|
||||
RootBlock rootBlock = Marshal.ByteArrayToStructureBigEndian<RootBlock>(rootBlockSector);
|
||||
|
||||
var sbInformation = new StringBuilder();
|
||||
Metadata = new FileSystem();
|
||||
metadata = new FileSystem();
|
||||
|
||||
switch(rootBlock.diskType)
|
||||
{
|
||||
case AFS_DISK:
|
||||
case MUAF_DISK:
|
||||
sbInformation.Append(Localization.Professional_File_System_v1);
|
||||
Metadata.Type = FS_TYPE;
|
||||
metadata.Type = FS_TYPE;
|
||||
|
||||
break;
|
||||
case PFS2_DISK:
|
||||
sbInformation.Append(Localization.Professional_File_System_v2);
|
||||
Metadata.Type = FS_TYPE;
|
||||
metadata.Type = FS_TYPE;
|
||||
|
||||
break;
|
||||
case PFS_DISK:
|
||||
case MUPFS_DISK:
|
||||
sbInformation.Append(Localization.Professional_File_System_v3);
|
||||
Metadata.Type = FS_TYPE;
|
||||
metadata.Type = FS_TYPE;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -116,12 +118,12 @@ public sealed partial class PFS
|
||||
|
||||
information = sbInformation.ToString();
|
||||
|
||||
Metadata.CreationDate =
|
||||
metadata.CreationDate =
|
||||
DateHandlers.AmigaToDateTime(rootBlock.creationday, rootBlock.creationminute, rootBlock.creationtick);
|
||||
|
||||
Metadata.FreeClusters = rootBlock.blocksfree;
|
||||
Metadata.Clusters = rootBlock.diskSize;
|
||||
Metadata.ClusterSize = imagePlugin.Info.SectorSize;
|
||||
Metadata.VolumeName = StringHandlers.PascalToString(rootBlock.diskname, Encoding);
|
||||
metadata.FreeClusters = rootBlock.blocksfree;
|
||||
metadata.Clusters = rootBlock.diskSize;
|
||||
metadata.ClusterSize = imagePlugin.Info.SectorSize;
|
||||
metadata.VolumeName = StringHandlers.PascalToString(rootBlock.diskname, Encoding);
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -39,8 +38,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of the Professional File System</summary>
|
||||
public sealed partial class PFS : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -128,10 +128,12 @@ public sealed partial class ProDOSPlugin
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? new Apple2c();
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
var sbInformation = new StringBuilder();
|
||||
uint multiplier = (uint)(imagePlugin.Info.SectorSize == 256 ? 2 : 1);
|
||||
|
||||
@@ -294,7 +296,7 @@ public sealed partial class ProDOSPlugin
|
||||
|
||||
information = sbInformation.ToString();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
VolumeName = rootDirectoryKeyBlock.header.volume_name,
|
||||
Files = rootDirectoryKeyBlock.header.file_count,
|
||||
@@ -302,12 +304,12 @@ public sealed partial class ProDOSPlugin
|
||||
Type = FS_TYPE
|
||||
};
|
||||
|
||||
Metadata.ClusterSize = (uint)((partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize /
|
||||
Metadata.Clusters);
|
||||
metadata.ClusterSize = (uint)((partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize /
|
||||
metadata.Clusters);
|
||||
|
||||
if(!dateCorrect)
|
||||
return;
|
||||
|
||||
Metadata.CreationDate = rootDirectoryKeyBlock.header.creation_time;
|
||||
metadata.CreationDate = rootDirectoryKeyBlock.header.creation_time;
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,6 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -42,8 +41,6 @@ namespace Aaru.Filesystems;
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Local"), SuppressMessage("ReSharper", "UnusedType.Local")]
|
||||
public sealed partial class ProDOSPlugin : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -84,10 +84,12 @@ public sealed partial class QNX4
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
ErrorNumber errno = imagePlugin.ReadSector(partition.Start + 1, out byte[] sector);
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
@@ -177,7 +179,7 @@ public sealed partial class QNX4
|
||||
string.Format(Localization.Created_on_0,
|
||||
DateHandlers.UnixUnsignedToDateTime(qnxSb.rootDir.di_ftime)) + "\n";
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
Clusters = partition.Length,
|
||||
@@ -186,6 +188,6 @@ public sealed partial class QNX4
|
||||
ModificationDate = DateHandlers.UnixUnsignedToDateTime(qnxSb.rootDir.di_mtime)
|
||||
};
|
||||
|
||||
Metadata.Bootable |= qnxSb.boot.di_size != 0 || qnxSb.altBoot.di_size != 0;
|
||||
metadata.Bootable |= qnxSb.boot.di_size != 0 || qnxSb.altBoot.di_size != 0;
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,6 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -39,8 +38,6 @@ namespace Aaru.Filesystems;
|
||||
[SuppressMessage("ReSharper", "UnusedType.Local")]
|
||||
public sealed partial class QNX4 : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -69,10 +69,12 @@ public sealed partial class QNX6
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
var sb = new StringBuilder();
|
||||
uint sectors = QNX6_SUPER_BLOCK_SIZE / imagePlugin.Info.SectorSize;
|
||||
uint bootSectors = QNX6_BOOT_BLOCKS_SIZE / imagePlugin.Info.SectorSize;
|
||||
@@ -108,7 +110,7 @@ public sealed partial class QNX6
|
||||
audiSb.freeBlocks * audiSb.blockSize, audiSb.numBlocks,
|
||||
audiSb.numBlocks * audiSb.blockSize).AppendLine();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
Clusters = audiSb.numBlocks,
|
||||
@@ -143,7 +145,7 @@ public sealed partial class QNX6
|
||||
qnxSb.freeBlocks * qnxSb.blockSize, qnxSb.numBlocks, qnxSb.numBlocks * qnxSb.blockSize).
|
||||
AppendLine();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
Clusters = qnxSb.numBlocks,
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -37,8 +36,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of QNX 6 filesystem</summary>
|
||||
public sealed partial class QNX6 : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -87,10 +87,12 @@ public sealed partial class RBF : IFilesystem
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
if(imagePlugin.Info.SectorSize < 256)
|
||||
return;
|
||||
@@ -192,7 +194,7 @@ public sealed partial class RBF : IFilesystem
|
||||
sb.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(rbf9000Sb.rid_name, Encoding)).
|
||||
AppendLine();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
Bootable = rbf9000Sb.rid_bootfile > 0,
|
||||
@@ -255,7 +257,7 @@ public sealed partial class RBF : IFilesystem
|
||||
sb.AppendFormat(Localization.Path_descriptor_options_0, StringHandlers.CToString(rbfSb.dd_opt, Encoding)).
|
||||
AppendLine();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
Bootable = LSNToUInt32(rbfSb.dd_bt) > 0 && rbfSb.dd_bsz > 0,
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -37,8 +36,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of the Locus filesystem</summary>
|
||||
public sealed partial class RBF : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -69,10 +69,12 @@ public sealed partial class RT11
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = new Radix50();
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
@@ -110,7 +112,7 @@ public sealed partial class RT11
|
||||
|
||||
imagePlugin.ReadSector(0, out byte[] bootBlock);
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
ClusterSize = (uint)(homeblock.cluster * 512),
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -42,8 +41,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of the DEC RT-11 filesystem</summary>
|
||||
public sealed partial class RT11 : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -68,10 +68,12 @@ public sealed partial class ReFS : IFilesystem
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = Encoding.UTF8;
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
uint sbSize = (uint)(Marshal.SizeOf<VolumeHeader>() / imagePlugin.Info.SectorSize);
|
||||
|
||||
@@ -136,7 +138,7 @@ public sealed partial class ReFS : IFilesystem
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
ClusterSize = vhdr.bytesPerSector * vhdr.sectorsPerCluster,
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -42,8 +41,6 @@ public sealed partial class ReFS : IFilesystem
|
||||
/// <inheritdoc />
|
||||
public Guid Id => new("37766C4E-EBF5-4113-A712-B758B756ABD6");
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public string Author => Authors.NataliaPortillo;
|
||||
|
||||
@@ -74,10 +74,12 @@ public sealed partial class Reiser : IFilesystem
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
if(imagePlugin.Info.SectorSize < 512)
|
||||
return;
|
||||
@@ -136,7 +138,7 @@ public sealed partial class Reiser : IFilesystem
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
ClusterSize = reiserSb.blocksize,
|
||||
@@ -148,7 +150,7 @@ public sealed partial class Reiser : IFilesystem
|
||||
if(reiserSb.version < 2)
|
||||
return;
|
||||
|
||||
Metadata.VolumeName = StringHandlers.CToString(reiserSb.label, Encoding);
|
||||
Metadata.VolumeSerial = reiserSb.uuid.ToString();
|
||||
metadata.VolumeName = StringHandlers.CToString(reiserSb.label, Encoding);
|
||||
metadata.VolumeSerial = reiserSb.uuid.ToString();
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -37,8 +36,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of the Reiser v3 filesystem</summary>
|
||||
public sealed partial class Reiser : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -73,10 +73,12 @@ public sealed partial class Reiser4
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
if(imagePlugin.Info.SectorSize < 512)
|
||||
return;
|
||||
@@ -114,7 +116,7 @@ public sealed partial class Reiser4
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
ClusterSize = reiserSb.blocksize,
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -37,8 +36,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of the Reiser v4 filesystem</summary>
|
||||
public sealed partial class Reiser4 : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -56,10 +56,12 @@ public sealed partial class SFS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
information = "";
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-1");
|
||||
metadata = new FileSystem();
|
||||
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, out byte[] rootBlockSector);
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
@@ -106,7 +108,7 @@ public sealed partial class SFS
|
||||
|
||||
information = sbInformation.ToString();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
CreationDate = DateHandlers.UnixUnsignedToDateTime(rootBlock.datecreated).AddYears(8),
|
||||
Clusters = rootBlock.totalblocks,
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
@@ -37,8 +36,6 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements detection of the Smart File System</summary>
|
||||
public sealed partial class SFS : IFilesystem
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public FileSystem Metadata { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -63,10 +63,12 @@ public sealed partial class SolarFS
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
|
||||
information = "";
|
||||
metadata = new FileSystem();
|
||||
|
||||
var sb = new StringBuilder();
|
||||
ErrorNumber errno = imagePlugin.ReadSector(0 + partition.Start, out byte[] bpbSector);
|
||||
@@ -154,7 +156,7 @@ public sealed partial class SolarFS
|
||||
sb.AppendFormat(Localization._0_sectors_per_track, bpb.sptrk).AppendLine();
|
||||
sb.AppendFormat(Localization.Volume_name_0, bpb.vol_name).AppendLine();
|
||||
|
||||
Metadata = new FileSystem
|
||||
metadata = new FileSystem
|
||||
{
|
||||
Type = FS_TYPE,
|
||||
Clusters = bpb.sectors,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user