diff --git a/BinaryObjectScanner/FileType/PKZIP.cs b/BinaryObjectScanner/FileType/PKZIP.cs index 5e1eae4f..c5717ef8 100644 --- a/BinaryObjectScanner/FileType/PKZIP.cs +++ b/BinaryObjectScanner/FileType/PKZIP.cs @@ -48,14 +48,14 @@ namespace BinaryObjectScanner.FileType if (!string.IsNullOrEmpty(file) && File.Exists(file!)) { // Find all file parts - var parts = ArchiveFactory.GetFileParts(new FileInfo(file)); + FileInfo[] parts = [.. ArchiveFactory.GetFileParts(new FileInfo(file))]; // Try to read the file path if no entries are found if (zipFile.Entries.Count == 0) zipFile = ZipArchive.Open(parts, readerOptions); - // If there's any multipart items, try reading the file as well - else if (!zipFile.IsComplete) + // If there are multiple parts + else if (parts.Length > 1) zipFile = ZipArchive.Open(parts, readerOptions); } diff --git a/BinaryObjectScanner/FileType/RAR.cs b/BinaryObjectScanner/FileType/RAR.cs index 4c98f258..b1f01fa3 100644 --- a/BinaryObjectScanner/FileType/RAR.cs +++ b/BinaryObjectScanner/FileType/RAR.cs @@ -49,14 +49,14 @@ namespace BinaryObjectScanner.FileType if (!string.IsNullOrEmpty(file) && File.Exists(file!)) { // Find all file parts - var parts = ArchiveFactory.GetFileParts(new FileInfo(file)); + FileInfo[] parts = [.. ArchiveFactory.GetFileParts(new FileInfo(file))]; // Try to read the file path if no entries are found if (rarFile.Entries.Count == 0) rarFile = RarArchive.Open(parts, readerOptions); // If there's any multipart items, try reading the file as well - else if (!rarFile.IsComplete) + else if (parts.Length > 1) rarFile = RarArchive.Open(parts, readerOptions); } diff --git a/BinaryObjectScanner/FileType/SevenZip.cs b/BinaryObjectScanner/FileType/SevenZip.cs index 0bd7cacd..82df1df8 100644 --- a/BinaryObjectScanner/FileType/SevenZip.cs +++ b/BinaryObjectScanner/FileType/SevenZip.cs @@ -49,14 +49,14 @@ namespace BinaryObjectScanner.FileType if (!string.IsNullOrEmpty(file) && File.Exists(file!)) { // Find all file parts - var parts = ArchiveFactory.GetFileParts(new FileInfo(file)); + FileInfo[] parts = [.. ArchiveFactory.GetFileParts(new FileInfo(file))]; // Try to read the file path if no entries are found if (sevenZip.Entries.Count == 0) sevenZip = SevenZipArchive.Open(parts, readerOptions); // If there's any multipart items, try reading the file as well - else if (!sevenZip.IsComplete) + else if (parts.Length > 1) sevenZip = SevenZipArchive.Open(parts, readerOptions); }