Autor Beitrag
Jocke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28

XP
D6 Pers
BeitragVerfasst: Fr 29.04.05 16:27 
Hallo,

ich habe gepackte Dateien mit der Endung .gz, die ich in Windows mit WinZip entpacken kann.

Nun versuche ich diese Dateien in einem Delphi Programm zu entpacken, aber sowohl mit ZipMaster als auch mit Abbrevia gibts Probleme, da diese wohl Probleme mit dem Format .gz haben. Die Fehlermeldung bei Zipmaster z.B. war

11036 DS_NoValidZip This archive is not a valid Zip archive

Kann mir mal jemand sagen, was .gz ist und ob es eine Komponente gibt, mit der ich das Archiv entpacken kann ?

_________________
mfg
Jocke
Asgar
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 160

XP Home Edition
D5
BeitragVerfasst: Fr 29.04.05 16:39 
hab was zur endung .gz gefunden www.gzip.org/ da is auch ein link zum dekompressions algorythmuss, vieleicht isses ja das richtige.
Grendel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 443

Gentoo Linux, MacOS X, Win 2000
D5 Ent, D7 Ent, Lazarus, Anjuta, MonoDevelop
BeitragVerfasst: Fr 29.04.05 16:47 
Ja isses. gz ist gzip.

Bis neulich ...
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Fr 29.04.05 17:10 
Delphi bringt Mark Adlers und Jean-Loup Gaillys zlib mit, der darin implementierte Algorithmus ist der gleiche wie für ZIP und gzip. Aktuell ist sie wahrscheinlich nicht mehr es ist wohl besser du lädtst dir die DLL runter und importierst deren Methoden. Die Dekompression sollte trotzdem funktionieren, aber die aktuelle zlib wurde beschleunigt und fehlerkorrigiert. Das Dateiformat zum Strom findest du hier und in den RFC.

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
Jocke Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28

XP
D6 Pers
BeitragVerfasst: Mo 02.05.05 15:06 
Danke für die Infos.

Allerdings komme ich hier nicht weiter.
Ich habe versucht, mich hier entsprechend zu informieren, allerdings bin ich jetzt total verwirrt.
Ich habe mal folgendes ausprobiert .

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
procedure Decompress(InputFileName, OutputFileName: string);
var
  InputStream, OutputStream : TFileStream;
  DeCompressionStream : TDeCompressionStream;
  a : ^byte;
  i : Integer;
begin
  InputStream := TFileStream.Create(InputFileName, fmOpenRead);
  GetMem(a,655360);
  try
    OutputStream := TFileStream.Create(OutputFileName, fmCreate);
    try
      DecompressionStream := TDecompressionStream.Create(InputStream);
      try
        repeat
          i:=DecompressionStream.Read(a^,655360);
          if i>0 then OutputStream.Write(a^,i);
        until i<655360;
        FreeMem(a);
      finally
        DecompressionStream.Free;
      end;
    finally
      OutputStream.Free;
    end;
  finally
    InputStream.Free;
  end;
end;


Dies rufe ich auf mit
Decompress('C:\test.gz','C:\test.csv');
Hier bekomme ich aber eine Fehlermeldung
Was mache ich hier falsch ?
Ist das denn so schwierig, eine Datei zu entpacken ?

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.

_________________
mfg
Jocke
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Mo 02.05.05 15:24 
user profile iconJocke hat folgendes geschrieben:
Hier bekomme ich aber eine Fehlermeldung
Was mache ich hier falsch ?
Das kann ich dir sagen, du machst was ganz grundlegendes falsch: Du sagst nicht, welche Fehlermeldung wann kommt.

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
Jocke Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28

XP
D6 Pers
BeitragVerfasst: Mo 02.05.05 15:41 
Tut mir leid, hier die Meldung :

Project test.exe raised exception class ECompressionError with message 'error'.Process stopped.

_________________
mfg
Jocke
Jocke Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28

XP
D6 Pers
BeitragVerfasst: Di 03.05.05 15:31 
Falls es jemanden interessiet, es gibt mit jrzip ein Interface für die Zlib Bibliothek, mit der man dann auch .gz Dateien entpacken kann.
Download unter www.ieap.uni-kiel.de...g-berndt/delphi.html

_________________
mfg
Jocke