[英]Extract .7Z file using sevenzip doesn't work for larger files >1GB
Sevenzip 提取器工作正常,可以很好地提取 small.7Z 文件。 用於提取大文件(1gb)時的相同代碼,得到以下異常。
SevenZipExtractor extractor = new SevenZipExtractor(@"\\Sourcepath\test_20191024143230.7z");
if (extractor.Check())
{
using (var tmp = new SevenZipExtractor(@"\\DestinationPath\test"))
{
for (int i = 0; i < tmp.ArchiveFileData.Count; i++)
{
tmp.ExtractFiles(@"C:\Users\ot97813\RPC_CodeBase\UnZip File\ExtractPath\", tmp.ArchiveFileData[i].Index);
}
}
}
查看了所有網站,我沒有發現這不支持提取更大的文件。 注意:該文件未加密或密碼保護。
這不是答案,只是證明SevenZipExtractor正在工作。
using System;
using SevenZipExtractor; // https://github.com/adoconnection/SevenZipExtractor
using ByteSizeLib; // https://github.com/omar/ByteSize
namespace ConsoleAppSevenZipExtractor
{
class Program
{
static void Main(string[] args)
{
using (ArchiveFile archiveFile = new ArchiveFile(@"C:\test.7z"))
{
foreach (var entry in archiveFile.Entries)
{
Console.WriteLine($"{entry.FileName} with {ByteSize.FromBytes(entry.Size)}");
// extract to file to current path
entry.Extract(entry.FileName);
}
}
Console.ReadKey();
}
}
}
使用的 7Zip 存檔大約有 2 Gb
控制台 output:
帶有 88.13 KB 的 text.txt
1.96 GB 的 video.mp4
promo.jpg 56.98 KB
在 bin/debug 文件中提取
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.