Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JEDI JCL Compression library wont open spanned archive files

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.

like image 533
Scott Maxwell Avatar asked Jul 04 '11 02:07

Scott Maxwell


1 Answers

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));

like image 145
TridenT Avatar answered Oct 14 '22 10:10

TridenT