From 3bce412c00390660e80c9e153a38ec0842339d28 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Mon, 31 May 2021 19:14:25 +0100 Subject: [PATCH] Make members of FileEntryInfo fields until we migrate to .NET 6. --- Aaru.CommonTypes | 2 +- Aaru.Filesystems/LisaFS/File.cs | 17 +++++++---------- Aaru.Tests/Structs.cs | 11 ++++++----- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/Aaru.CommonTypes b/Aaru.CommonTypes index 493ba5dd4..c0002b1f4 160000 --- a/Aaru.CommonTypes +++ b/Aaru.CommonTypes @@ -1 +1 @@ -Subproject commit 493ba5dd4c14994bbc32630feae63ae7bd7d0ed8 +Subproject commit c0002b1f4fb49cde18d2de62eb6bd26ae32e06e6 diff --git a/Aaru.Filesystems/LisaFS/File.cs b/Aaru.Filesystems/LisaFS/File.cs index df91387d1..d9d6d8ac2 100644 --- a/Aaru.Filesystems/LisaFS/File.cs +++ b/Aaru.Filesystems/LisaFS/File.cs @@ -277,12 +277,11 @@ namespace Aaru.Filesystems.LisaFS return Errno.NoSuchFile; else { - stat = new FileEntryInfo - { - Attributes = new FileAttributes() - }; + stat = new FileEntryInfo(); - error = GetAttributes(fileId, out stat.Attributes); + error = GetAttributes(fileId, out FileAttributes attrs); + + stat.Attributes = attrs; if(error != Errno.NoError) return error; @@ -328,12 +327,10 @@ namespace Aaru.Filesystems.LisaFS return Errno.NoError; } - stat = new FileEntryInfo - { - Attributes = new FileAttributes() - }; + stat = new FileEntryInfo(); - error = GetAttributes(fileId, out stat.Attributes); + error = GetAttributes(fileId, out FileAttributes fileAttributes); + stat.Attributes = fileAttributes; if(error != Errno.NoError) return error; diff --git a/Aaru.Tests/Structs.cs b/Aaru.Tests/Structs.cs index f63f19a8c..1c8151e28 100644 --- a/Aaru.Tests/Structs.cs +++ b/Aaru.Tests/Structs.cs @@ -32,6 +32,7 @@ namespace Aaru.Tests /// Bytes per cluster public uint ClusterSize; public Dictionary Contents; + public string ContentsJson; public Encoding Encoding; public FileSystemInfo Info; public string Namespace; @@ -91,11 +92,11 @@ namespace Aaru.Tests public class FileData { - public Dictionary Children; - public FileEntryInfo Info; - public string LinkTarget; - public string MD5; - public Dictionary XattrsWithMd5; + public Dictionary Children { get; set; } + public FileEntryInfo Info { get; set; } + public string LinkTarget { get; set; } + public string MD5 { get; set; } + public Dictionary XattrsWithMd5 { get; set; } } public class VolumeData