mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-04-28 01:00:50 +00:00
Use file part count, not partial files
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user