aarre: compress via gzip

git-svn-id: trunk@41705 -
This commit is contained in:
mattias 2013-06-13 19:53:15 +00:00
parent 191934ab45
commit 33cfc279d4

View File

@ -541,14 +541,23 @@ end;
procedure TAarrePkgList.SaveToFile(const aFilename: string);
var
xml: TXMLConfig;
fs: TGZFileStream;
ms: TMemoryStream;
Cnt: LongInt;
begin
xml:=TXMLConfig.Create(aFilename);
fs:=TGZFileStream.create(aFilename,gzopenwrite);
try
Save(XML,'');
xml.Flush;
ms:=TMemoryStream.Create;
try
SaveToStream(ms);
Cnt:=fs.write(ms.Memory^,ms.Size);
if Cnt<ms.Size then
raise Exception.Create('write error "'+aFilename+'"');
finally
ms.Free;
end;
finally
xml.Free;
fs.Free;
end;
end;