Replace Read method with ReadFile method that uses the file node in IFileSystem.

This commit is contained in:
2022-12-19 11:03:51 +00:00
parent 0fc479a529
commit b4b2868c22
18 changed files with 1780 additions and 1271 deletions

View File

@@ -38,6 +38,7 @@ using System.Linq;
using System.Reactive;
using System.Threading.Tasks;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Interfaces;
using Aaru.CommonTypes.Interop;
using Aaru.CommonTypes.Structs;
using Aaru.Console;
@@ -316,9 +317,15 @@ public sealed class SubdirectoryViewModel
try
{
byte[] outBuf = Array.Empty<byte>();
byte[] outBuf = new byte[file.Stat.Length];
ErrorNumber error = _model.Plugin.Read(_model.Path + "/" + file.Name, 0, file.Stat.Length, ref outBuf);
ErrorNumber error = _model.Plugin.OpenFile(_model.Path + "/" + file.Name, out IFileNode fileNode);
if(error == ErrorNumber.NoError)
{
error = _model.Plugin.ReadFile(fileNode, file.Stat.Length, outBuf, out _);
_model.Plugin.CloseFile(fileNode);
}
if(error != ErrorNumber.NoError)
{