Sign in Join

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

Mailing lists / fpc-pascal / 2020-08

Archive libraries

12 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

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

Darius Blaszyk

Hi all,

To my delight I found out that FPC actually provides quite a few archive handling libraries out of the box. Thanks to all that have contributed to that! So far I found:

* tar
* tar.gz
* zip

Are there any other formats out there that I could use like out of the box?

TIA!

Darius

Reply by email

Tomas Hajny
to Darius Blaszyk

On 2020-08-20 17:10, Darius Blaszyk via fpc-pascal wrote:

Hi,

Show quoted text 12 lines
To my delight I found out that FPC actually provides quite a few archive handling libraries out of the box. Thanks to all that have contributed to that! So far I found: * tar * tar.gz * zip Are there any other formats out there that I could use like out of the box?

bzip2 is directly supported in FPC packages as well.

There are 3rd party Pascal units supporting work with other archive formats (mostly listing and decompression) either using shared libraries, or containing direct implementation of certain functionality (there has been e.g. unrar.pas containing a port of the original C implementation to Pascal, although it wouldn't support current RAR format versions) and which might be compiled with FPC rather easily, but you're on your own there, of course.

Tomas

Reply by email

Anton Shepelev
to Tomas Hajny

Tomas Hajny:

Show quoted text 9 lines
There are 3rd party Pascal units supporting work with other archive formats (mostly listing and decompression) either using shared libraries, or containing direct implementation of certain functionality (there has been e.g. unrar.pas containing a port of the original C implementation to Pascal, although it wouldn't support current RAR format versions) and which might be compiled with FPC rather easily, but you're on your own there, of course.

As a last resort, one might invoke the required archiver executable, passing to it any necessary parameters. Far Manager's MultiArc universal plugin works exactly that way, and is easily configurable via invocation patterns with macros.

Reply by email

Darius Blaszyk
to Tomas Hajny: bzip2 is directly supported in FPC packages as well. There are 3rd party Pascal units…

I found it thanks! Any example for compressing to bzip2? The examples folder seems to contain two examples how to decompress, although the name would suggest otherwise.

What about peazip, is there anyone on this mailing list that can tell how this software works? Does it have native pascal implementations or does it work with wrappers to libraries?

Sorry for asking, but I need it for providing different archives in a buildbot project. I want to cover as much as possible formats without delving too much into detail.

Rgds, Darius

On Thu, Aug 20, 2020 at 5:58 PM Tomas Hajny via fpc-pascal <

Show quoted text 35 lines
wrote: On 2020-08-20 17:10, Darius Blaszyk via fpc-pascal wrote: Hi, > To my delight I found out that FPC actually provides quite a few > archive > handling libraries out of the box. Thanks to all that have contributed > to > that! So far I found: > > * tar > * tar.gz > * zip > > Are there any other formats out there that I could use like out of the > box? bzip2 is directly supported in FPC packages as well. There are 3rd party Pascal units supporting work with other archive formats (mostly listing and decompression) either using shared libraries, or containing direct implementation of certain functionality (there has been e.g. unrar.pas containing a port of the original C implementation to Pascal, although it wouldn't support current RAR format versions) and which might be compiled with FPC rather easily, but you're on your own there, of course. Tomas _______________________________________________ fpc-pascal maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Travis Siegel
to Darius Blaszyk: To my delight I found out that FPC actually provides quite a few archive handling…

There's also bzip2 and chm (though I don't really consider that an archive format).  I don't see anything for arj or rar though, both of which I use extensively.  Perhaps I'll see what I can do about those two.  arj should be easy enough, since unarj source is available, it should be convertable.  Having not worked on such a project though, I haven't a clue how much work it will be, but what the heck.

Darius Blaszyk wrote 20 lines
Hi all, To my delight I found out that FPC actually provides quite a few archive handling libraries out of the box. Thanks to all that have contributed to that! So far I found: * tar * tar.gz * zip Are there any other formats out there that I could use like out of the box? TIA! Darius _______________________________________________ fpc-pascal maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Darius Blaszyk
to Anton Shepelev: Tomas Hajny: As a last resort, one might invoke the required archiver executable, passing…
Show quoted text 6 lines
As a last resort, one might invoke the required archiver executable, passing to it any necessary parameters. Far Manager's MultiArc universal plugin works exactly that way, and is easily configurable via invocation patterns with macros.

I have done so for the xz format already. The code checks first if the utility is available and then invokes it. Potentially any other utility might be included that way. However, I was hoping to include mainly native libraries where possible to reduce dependencies.

TIA!

Darius

Reply by email

Marco Borsari
to Darius Blaszyk: To my delight I found out that FPC actually provides quite a few archive handling…

Il 20/08/2020 17:10, Darius Blaszyk via fpc-pascal ha scritto:

Show quoted text 9 lines
To my delight I found out that FPC actually provides quite a few archive handling libraries out of the box. Thanks to all that have contributed to that! So far I found: * tar * tar.gz * zip Are there any other formats out there that I could use like out of the box?

I have taken the naked LZH (LH5) by Okumura-Yoshizaki from the SWAG and I added his historical format archive around it, though in a minimal form. You can find it at the link

http://digilander.libero.it/oldpumpkin

in the entry "Lempel-(Ziv)-Huffman arc".
The executable herein is in Dos32 but it compiles even for Windows.

Reply by email

Darius Blaszyk
to Marco Borsari

Thank you Marco! I will have a

On Fri, Aug 21, 2020 at 11:04 AM Marco Borsari via fpc-pascal <

Show quoted text 27 lines
wrote: Il 20/08/2020 17:10, Darius Blaszyk via fpc-pascal ha scritto: > To my delight I found out that FPC actually provides quite a few archive > handling libraries out of the box. Thanks to all that have contributed > to that! So far I found: > > * tar > * tar.gz > * zip > > Are there any other formats out there that I could use like out of the box? I have taken the naked LZH (LH5) by Okumura-Yoshizaki from the SWAG and I added his historical format archive around it, though in a minimal form. You can find it at the link http://digilander.libero.it/oldpumpkin in the entry "Lempel-(Ziv)-Huffman arc". The executable herein is in Dos32 but it compiles even for Windows. _______________________________________________ fpc-pascal maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Darius Blaszyk
to Darius Blaszyk: I have done so for the xz format already. The code checks first if the utility is…
PM Darius Blaszyk wrote 6 lines
I have done so for the xz format already. The code checks first if the utility is available and then invokes it. Potentially any other utility might be included that way. However, I was hoping to include mainly native libraries where possible to reduce dependencies.

By calling the archive utility from the command line I am able to add more formats easily. One thing though is that to be more robust I would like to check the availability of the utility from the command line. One way of doing this is using "whereis", but I was wondering if something like this exists already in FPC?

Rgds, Darius

Reply by email

Michael Van Canneyt
to Darius Blaszyk
Darius Blaszyk wrote 15 lines
On Thu, Aug 20, 2020 at 11:43 PM Darius Blaszyk wrote: > > I have done so for the xz format already. The code checks first if the > utility is available and then invokes it. Potentially any other utility > might be included that way. However, I was hoping to include mainly native > libraries where possible to reduce dependencies. > By calling the archive utility from the command line I am able to add more formats easily. One thing though is that to be more robust I would like to check the availability of the utility from the command line. One way of doing this is using "whereis", but I was wondering if something like this exists already in FPC?

Yes:

https://www.freepascal.org/docs-html/current/rtl/sysutils/exesearch.html

Combine with GetEnvironmentVariable():

Exists:=ExeSearch('myexe',GetEnvironmentVariable('PATH'));

Michael.

Reply by email

Darius Blaszyk
to Michael Van Canneyt

Thank you Michael!

AM Michael Van Canneyt wrote 33 lines
On Sat, 22 Aug 2020, Darius Blaszyk via fpc-pascal wrote: > On Thu, Aug 20, 2020 at 11:43 PM Darius Blaszyk > wrote: > >> >> I have done so for the xz format already. The code checks first if the >> utility is available and then invokes it. Potentially any other utility >> might be included that way. However, I was hoping to include mainly native >> libraries where possible to reduce dependencies. >> > > By calling the archive utility from the command line I am able to add more > formats easily. One thing though is that to be more robust I would like to > check the availability of the utility from the command line. One way of > doing this is using "whereis", but I was wondering if something like this > exists already in FPC? Yes: https://www.freepascal.org/docs-html/current/rtl/sysutils/exesearch.html Combine with GetEnvironmentVariable(): Exists:=ExeSearch('myexe',GetEnvironmentVariable('PATH')); Michael.

Reply by email