mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
REFACTOR: Final cleanup of DiscImageChef.Filesystems.
This commit is contained in:
@@ -159,8 +159,14 @@ namespace DiscImageChef.Filesystems.UCSDPascal
|
||||
{
|
||||
entry = new PascalFileEntry();
|
||||
|
||||
foreach(PascalFileEntry ent in fileEntries.Where(ent => string.Compare(path, StringHandlers.PascalToString(ent.filename, CurrentEncoding),
|
||||
StringComparison.InvariantCultureIgnoreCase) == 0)) {
|
||||
foreach(PascalFileEntry ent in fileEntries.Where(ent =>
|
||||
string.Compare(path,
|
||||
StringHandlers
|
||||
.PascalToString(ent.filename,
|
||||
CurrentEncoding),
|
||||
StringComparison
|
||||
.InvariantCultureIgnoreCase) == 0))
|
||||
{
|
||||
entry = ent;
|
||||
return Errno.NoError;
|
||||
}
|
||||
|
||||
@@ -80,13 +80,10 @@ namespace DiscImageChef.Filesystems.UCSDPascal
|
||||
if(volEntry.blocks < 0 || (ulong)volEntry.blocks != imagePlugin.GetSectors()) return false;
|
||||
|
||||
// There can be not less than zero files
|
||||
if(volEntry.files < 0) return false;
|
||||
|
||||
return true;
|
||||
return volEntry.files >= 0;
|
||||
}
|
||||
|
||||
public override void GetInformation(ImagePlugin imagePlugin, Partition partition,
|
||||
out string information)
|
||||
public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information)
|
||||
{
|
||||
StringBuilder sbInformation = new StringBuilder();
|
||||
information = "";
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
|
||||
public short dummy;
|
||||
/// <summary>0x14, last booted</summary>
|
||||
public short lastBoot;
|
||||
/// <summary>0x16, tail to make record same size as <see cref="PascalFileEntry"/></summary>
|
||||
/// <summary>0x16, tail to make record same size as <see cref="PascalFileEntry" /></summary>
|
||||
public int tail;
|
||||
}
|
||||
|
||||
|
||||
@@ -121,13 +121,15 @@ namespace DiscImageChef.Filesystems.UCSDPascal
|
||||
|
||||
public override Errno StatFs(ref FileSystemInfo stat)
|
||||
{
|
||||
stat = new FileSystemInfo();
|
||||
stat.Blocks = mountedVolEntry.blocks;
|
||||
stat.FilenameLength = 16;
|
||||
stat.Files = (ulong)mountedVolEntry.files;
|
||||
stat.FreeBlocks = 0;
|
||||
stat.PluginId = PluginUuid;
|
||||
stat.Type = "UCSD Pascal";
|
||||
stat = new FileSystemInfo
|
||||
{
|
||||
Blocks = mountedVolEntry.blocks,
|
||||
FilenameLength = 16,
|
||||
Files = (ulong)mountedVolEntry.files,
|
||||
FreeBlocks = 0,
|
||||
PluginId = PluginUuid,
|
||||
Type = "UCSD Pascal"
|
||||
};
|
||||
|
||||
stat.FreeBlocks = mountedVolEntry.blocks - (mountedVolEntry.lastBlock - mountedVolEntry.firstBlock);
|
||||
foreach(PascalFileEntry entry in fileEntries) stat.FreeBlocks -= entry.lastBlock - entry.firstBlock;
|
||||
|
||||
@@ -42,14 +42,14 @@ namespace DiscImageChef.Filesystems.UCSDPascal
|
||||
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
|
||||
public partial class PascalPlugin : Filesystem
|
||||
{
|
||||
bool mounted;
|
||||
bool debug;
|
||||
readonly ImagePlugin device;
|
||||
|
||||
PascalVolumeEntry mountedVolEntry;
|
||||
List<PascalFileEntry> fileEntries;
|
||||
byte[] bootBlocks;
|
||||
byte[] catalogBlocks;
|
||||
bool debug;
|
||||
List<PascalFileEntry> fileEntries;
|
||||
bool mounted;
|
||||
|
||||
PascalVolumeEntry mountedVolEntry;
|
||||
|
||||
public PascalPlugin()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user