delphi - JEDI JCL 压缩库无法打开跨区存档文件

标签 delphi compression jedi jedi-code-library

摘要:

我无法让 JCL 压缩库打开任何跨区存档。 它显示了 borlands 'windows.pas' 中定义的错误“(0000001) 错误函数”;

场景:

使用 JCL 压缩示例压缩的单个存档。
- 将在 JCL 示例和 7zip gui 中解压缩。

使用 JCL 压缩示例压缩的超过 7 个文件的跨存档。
- 仅在 7zip gui 中解压缩。使用 JCL 示例解压缩失败。

使用 7zip gui 压缩的单个存档。
- 将在 JCL 示例和 7zip gui 中解压缩。

使用 7zip gui 压缩超过 7 个文件的跨区存档。
- 仅在 7zip gui 中解压缩。使用 JCL 解压缩失败

额外信息

JCL 压缩演示是包含在 JCL 库中的演示。
JCL:2.2.1.3970
7zip dll:9.20.0.0 和 9.65.0.0
跨区存档集中的示例文件名:“Test Archive.7z.002”
尝试使用 .tar 和 .7z 压缩
使用了不同的文件大小。 2048字节和2048KB
德尔福2009。

这是我使用的代码。 它来自 JCL 压缩演示。 行“TJclDecompressArchive(FArchive).ListFiles”发生错误。

procedure TFormMain.ActionOpenROExecute(Sender: TObject);
var
  ArchiveFileName, Password: string;
  AFormat: TJclDecompressArchiveClass;
  SplitArchive: Boolean;
begin
  if OpenDialogArchiveRO.Execute then
  begin
    CloseArchive;

ArchiveFileName := OpenDialogArchiveRO.FileName;
SplitArchive := AnsiSameText(ExtractFileExt(ArchiveFileName), '.001');
if SplitArchive then
  ArchiveFileName := ChangeFileExt(ArchiveFileName, '');

AFormat := GetArchiveFormats.FindDecompressFormat(ArchiveFileName);

if AFormat <> nil then
begin
  if SplitArchive then
    ArchiveFileName := ArchiveFileName + '.%.3d';

  InputQuery('Archive password', 'Value', Password);

  FArchive := AFormat.Create(ArchiveFileName, 0, SplitArchive);
  FArchive.Password := Password;
  FArchive.OnProgress := ArchiveProgress;

  if FArchive is TJclDecompressArchive then
    TJclDecompressArchive(FArchive).ListFiles
  else
  if FArchive is TJclUpdateArchive then
    TJclUpdateArchive(FArchive).ListFiles;

  ListView1.Items.BeginUpdate;
  try
    while ListView1.Items.Count < FArchive.ItemCount do
      ListView1.Items.Add;
  finally
    ListView1.Items.EndUpdate;
  end;
end
else
  ShowMessage('not a supported format');
  end;
end;

JCL 示例确实了解这些文件并打开它们。 (图像中使用的 zip 格式。同样的问题)。 Image of files opened by JCL compression example.

也许有人以前遇到过这个?。
谁能指出我正确的方向吗?
感谢您抽出宝贵时间。

斯科特·M.

最佳答案

该错误存在于 Project JEDI - Issue Tracker 中。

http://issuetracker.delphi-jedi.org/bug_view_advanced_page.php?bug_id=5137

两种可能的解决方法

  • 将您的 JCL 安装升级到 latest daily build
  • procedure TJclSevenzipDecompressArchive.OpenArchive; 处的 JclCompression.pas 中注释以下行并重建包。

    //注释此行!
    SevenzipCheck(InArchive.Open(AInStream, @MaxCheckStartPosition, OpenCallback));

关于delphi - JEDI JCL 压缩库无法打开跨区存档文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6566738/

相关文章:

Delphi:带有内置包的 .exe:600kb,.exe + 外部 BPL:6MB。这是为什么?

Delphi 应用程序调用 cobol 应用程序 -> 错误

compression - 为什么 Base64 编码的数据压缩效果这么差?

c - 在什么情况下压缩数据会大于输入?

delphi - Delphi XE3无法播放GIF动画?

delphi - 如何翻译delphi中数组中声明的字符串?

delphi - 我想禁用 JEDI 字符串属性编辑器

python - 多个 jediepcserver.py 用于多个 virtualenv

python-3.x - python 3.6.3。 zlib压缩

visual-studio-code - VScode Pylance python文件路径自动补全