Dokumentaro de Gambaso
Compilation & Installation
Components
gb
gb.crypt
gb.qt4
Documents
Indekso de Lingvo
Language Overviews
LeguMin
Lexicon
Registro

gb.compress

This component allows you to compress and uncompress Files, and to read and write compressed files using standard stream methods. It allows you to compress and uncompress strings in memory, too.

Currently it can use two algorithms, provided by zlib and libbzip2. The more known programs using these algorithms are the command line tools "gzip" and "bzip2", so you can handle the files generated by these programs.

This component internally uses the "libz" and "libbz2" libraries, so you need to install these libraries onto the computers that are going to use the compression component. If you plan to use just one of these algorithms, you don't need to install both libraries.

More information about internals at:

http://www.gzip.org/zlib/

http://sources.redhat.com/bzip2/

All common GNU/Linux distributions include packages for these libraries, FreeBSD and other Unixes too. Both data compressors are patent-free, and currently can be used even in not open source programs, if you follow all the instructions contained in their licenses. (read them carefully for the version you plan to use)

Since 3.16

Support for zstd compression has been added by Laurent Carlier in Gambas 3.16.

More information about this compression format at https://github.com/facebook/zstd.

Authors Daniel Campos Fernández, Laurent Carlier.

Class Description
Compress This class allows Gambas to use compression algorithms, in order to compress files, strings in memory, and to write a compressed file using standard Stream methods.
Uncompress This class allows Gambas to use compression algorithms, in order to uncompress files, strings in memory, and to read a compressed file using standard Stream methods.

Note:

This class is for dealing with single files only and cannot be used as an archiver/unarchiver of multiple files inside an archive.

For accessing archive contents you must use system command line tools like tar, zip/unzip, etc