Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2016-10

Can I open XZ compressed text file on the fly?

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Gabor Boros

Hi All,

I need to analyze log file but its compressed with XZ. Can I open it without decompress it to the file system or can decompress in memory for example into a TStringList?

Gabor

Graeme Geldenhuys
to Gabor Boros
Gabor Boros wrote
Can I open it without decompress it to the file system

Yes, simply use any component that implements the LZMA/LZMA2 compression algorithms. You should then be able to decompress it in memory. I think the TurboPower Abbrevia components on SourceForge support that. There are probably other compression components that you can use too.

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp
Gabor Boros
to Graeme Geldenhuys

2016. 10. 27. 4:29 keltezéssel, Graeme Geldenhuys írta:

Show quoted text 12 lines
On 2016-10-26 14:58, Gabor Boros wrote: > Can I open it > without decompress it to the file system Yes, simply use any component that implements the LZMA/LZMA2 compression algorithms. You should then be able to decompress it in memory. I think the TurboPower Abbrevia components on SourceForge support that. There are probably other compression components that you can use too. Regards, Graeme

Thank you Graeme!

I found this unit and works like a charm for me:

https://github.com/delphiunderground/xz-examples-delphi/blob/master/XZ.pas

Gabor