JEDI JCL Compression library wont open spanned archive files
Asked Answered
F

1

11

Summary:

I am having trouble to get the JCL compression library to open any spanned archives. It presents the error "(0000001) Incorrect Function" as defined in borlands 'windows.pas';

scenerios:

A single archive compressed using the JCL compression example.
-Will uncompress in both the JCL example and the 7zip gui.

A spanned archive over 7 files compressed using the JCL compression example.
-Will uncompress in only the 7zip gui. Fails to uncompress using JCL example.

A single archive compressed using the 7zip gui.
-Will uncompress in both the JCL example and the 7zip gui.

A spanned archive compressed over 7 files using the 7zip gui.
-Will uncompress in only the 7zip gui. Fails to uncompress using JCL

Extra information

The JCL compression demo is the one included with the JCL library.
JCL: 2.2.1.3970
7zip dll: 9.20.0.0 and 9.65.0.0
Example filename in spanned archive set: "Test Archive.7z.002"
Tried with both .tar and .7z compression
Different file sizes were used. 2048 bytes and 2048KB
Delphi 2009.

This is the code im using. Its from the JCL compression demo. Error occurs on line '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;

The JCL example does know about the files and does open them. (zip format used in image. Same problem). Image of files opened by JCL compression example.

Prehaps someone has come across this before?.
Can anyone point me in the right direction please?.
Thank you for your time.

Scott M.

Fallacious answered 4/7, 2011 at 2:9 Comment(2)
What's the classname of FArchive. Where in the method TxxxDecompressArchive.ListFiles does the exception occurs?Furl
@Lieven The exception come from procedure TJclSevenzipDecompressArchive.OpenArchive at the SevenzipCheck() call.Juarez
J
2

This bug exists in Project JEDI - Issue Tracker.

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

Two possible work-around

  • Upgrade your JCL installation to latest daily build
  • Comment the following line in JclCompression.pas at procedure TJclSevenzipDecompressArchive.OpenArchive; and rebuild the packages.

    // comment this line !
    SevenzipCheck(InArchive.Open(AInStream, @MaxCheckStartPosition, OpenCallback));

Juarez answered 29/9, 2011 at 19:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.