Recent

Author Topic: Abbrevia or other good compression library?  (Read 3277 times)

el3ctrolyte

  • Guest
Abbrevia or other good compression library?
« on: January 01, 2021, 02:00:06 pm »
Hey everyone! I want to write a program that needs to use compression. I know that fpc comes with libraries for this, but they are limited. Basically i want to be able to extract just one file form the zip but the libraries included in fpc doesn't have this feature. Abbrevia seems to be the library that i should use, but the fpc/lazarus version hasn't been updated in ages. And the delphi version is pretty up to date. Is there a other library that i can use? or is there a newer version of abbrevia available?

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Abbrevia or other good compression library?
« Reply #1 on: January 01, 2021, 02:44:10 pm »
Basically i want to be able to extract just one file form the zip but the libraries included in fpc doesn't have this feature.

What do you mean? You can do it perfectly with TUnzipper, using Unzip() or UnzipFile ...

Anyway, I think you can use the normal Abbrevia (the one at SourceForge): IIRC most of TurboPower packages were modified to be usable also with Lazarus, not only Delphi, to avoid having special, Lazarus-only forks.
« Last Edit: January 01, 2021, 02:50:27 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

el3ctrolyte

  • Guest
Re: Abbrevia or other good compression library?
« Reply #2 on: January 01, 2021, 05:55:27 pm »
Ahh i misspoke! Sorry. What i meant was i wanted to add a file to an existing zip file. Can i do this with what is included in lazarus/fpc?

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Abbrevia or other good compression library?
« Reply #3 on: January 01, 2021, 06:35:09 pm »
Ahh i misspoke! Sorry. What i meant was i wanted to add a file to an existing zip file. Can i do this with what is included in lazarus/fpc?

Yes, of course: TZipper class, methods Zip() or ZipFile() :)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

el3ctrolyte

  • Guest
Re: Abbrevia or other good compression library?
« Reply #4 on: January 01, 2021, 08:39:36 pm »
Are you sure. I know how to make zip files, but i want to add files to an existing zip file that already has files in it without extracting the zip file and then recompressing it. Maybe you can give me a code sample that shows how to add a file to an existing zip file that already has files it it.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Abbrevia or other good compression library?
« Reply #5 on: January 01, 2021, 10:03:15 pm »
I'm a tiny bit busy ATM (it's supper time here around), but I'll try to do it in the next couple hours, OK?
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Abbrevia or other good compression library?
« Reply #6 on: January 01, 2021, 11:13:42 pm »
Ok, it seems you were right, sorry :-[

I made a very quick, simple test and TZipper always overwrites the archive, adding only those files you add to it in the moment. I kind of remembered we using it to update an archive but if so it must have been after some heavy modifications :-\

It looks like you'll have to either complicate your (programming) life or just use Abbrevia, which works quite well ... at least it did last time I used it, though that was with Delphi :-X
« Last Edit: January 01, 2021, 11:15:49 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

jcmontherock

  • Full Member
  • ***
  • Posts: 236
Re: Abbrevia or other good compression library?
« Reply #7 on: January 02, 2021, 11:48:14 am »
Find Abbrevia 5.2 taken from CodeTyphon.
Windows 11 UTF8-64 - Lazarus 3.2-64 - FPC 3.2.2

el3ctrolyte

  • Guest
Re: Abbrevia or other good compression library?
« Reply #8 on: January 02, 2021, 02:55:20 pm »
The latest delphi version from github is 10.4.1
https://github.com/TurboPack/Abbrevia

jcmontherock

  • Full Member
  • ***
  • Posts: 236
Re: Abbrevia or other good compression library?
« Reply #9 on: January 03, 2021, 04:52:09 pm »
In fact it's a 6.91 version as written in lpk file (?).
« Last Edit: January 03, 2021, 04:54:13 pm by jcmontherock »
Windows 11 UTF8-64 - Lazarus 3.2-64 - FPC 3.2.2

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Abbrevia or other good compression library?
« Reply #10 on: January 04, 2021, 04:14:00 pm »
Find Abbrevia 5.2 taken from CodeTyphon.
I did not put it into ct4laz and OPM because there is already FPC version available here: http://tpabbrevia.sourceforge.net

In fact it's a 6.91 version as written in lpk file (?).
No, that is version of CodeTyphon in which it was last updated.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

 

TinyPortal © 2005-2018