#1 2024-10-07 05:33:58

bigheart
Member
Registered: 2014-08-01
Posts: 53

Is there any example uncompress *.tgz file using mormot2?

Hi, all.

I want to uncompress the *.tgz file which is compressed on the linux system.

I have tested the sample of the function TTestCoreCompression.GZipFormat in the test.core.data.pas, but unsuccessful.

My computer is win10 + delphi XE5.

Please give me some advice.

Offline

#2 2024-10-07 06:40:03

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Is there any example uncompress *.tgz file using mormot2?

tgz is .tar + .gz
mormot.core.zip supports .gz but not .tar.

For .tgz uncompress, use
https://github.com/synopse/mORMot2/blob … in7zip.pas
and a .7z dll.

Offline

#3 2024-11-02 03:05:12

bigheart
Member
Registered: 2014-08-01
Posts: 53

Re: Is there any example uncompress *.tgz file using mormot2?

Hi,

Please check the below code for decompress .tgz file using mormot.lib.win7zip.

var
  L7zip: I7zReader;
begin
  L7zip := New7zReader('c:\temp\test.tgz', fhUndefined, F7zDllName);
  L7Zip.ExtractAll('c:\temp\test', True);

I got an error as below:

TFileStreamEx.Create(c:\temp\test\) failed as ERROR_PATH_NOT_FOUND

Need your help.

Thanks in advance.

*)PS: when symbolic link(come from linux system) is contained in the .tgz , then above error.

Last edited by bigheart (2024-11-02 05:13:46)

Offline

#4 2024-11-02 15:31:26

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Is there any example uncompress *.tgz file using mormot2?

I guess, the error message means that you need to have the destination folder already existing.

Offline

#5 2024-11-02 23:56:38

bigheart
Member
Registered: 2014-08-01
Posts: 53

Re: Is there any example uncompress *.tgz file using mormot2?

Of course 'c:\temp\test' folder alreay exists.

Offline

Board footer

Powered by FluxBB