D.2 Compressing files

This module has an internal state, stored in global variables. The state holds informations about:

Initialisation

Function: mbfl_file_enable_compress

Declare the programs required to compress a file. Declaring the intention to use a program

The programs are: gzip, bzip2, lzip, xz.

Configuration

The selection will affect all the future invocations of the compression/decompression functions.

Function: mbfl_file_compress_select_gzip
Function: mbfl_file_compress_select_bzip
Function: mbfl_file_compress_select_bzip2
Function: mbfl_file_compress_select_lzip
Function: mbfl_file_compress_select_xz

Select a compressor program.

Function: mbfl_file_compress_keep
Function: mbfl_file_compress_nokeep

Select whether the compress program should keep the original file or not.

Function: mbfl_file_compress_select_stdout
Function: mbfl_file_compress_select_nostdout

Select if the output must be sent to stdout or a file. This takes precedence over the keep/no keep configuration: if the output is sent to stdout the original file is kept.

Actions

Additional arguments to the selected compressor may be appended to the invocation of the following functions and are handed to the compressor unchanged.

Function: mbfl_file_compress PATHNAME OPT

Compress PATHNAME, a file pathname, with the currently selected compressor program.

Function: mbfl_file_decompress PATHNAME OPT

Decompress PATHNAME, a file pathname, with the currently selected compressor program.


This document describes version 3.0.0-devel.9 of Marcos Bash Functions Library.