Application Suite: Squash
Squash is an application which compresses files using the RISC OS Squash module. The Squash module compresses using a 12-bit LZW algorithm. As an alternative you can use the built in RISC OS Six ZIP module to produce GZIP compatible ZIP files.
To use Squash simply double click on the !Squash application icon (shown left) in the Apps icon on the iconbar. This will install !Squash on the icon bar where the Squash icon will then appear.
Compressing a file
To compress a file simply drag it to the Squash icon on the icon bar. A Save as window will then appear. This will contain the original file name in the writable field.
To save the compressed file you can either:
Decompressing a file
To decompress a file you can:
Compressing and decompressing files and directories
To compress or decompress a directory just drag the directory to the Squash icon on the icon bar. A window will then appear similar to the one shown below.
First make sure that the appropriate button Squash or Unsquash is selected. When this is done you can proceed as for compressing or decompressing a single file.
When compressing a directory (which can be an 'ordinary' directory or an application directory) Squash leaves the directory and file structure intact and compresses each individual file in the directory and any sub-directories within it.
The icon bar menu
Squash has one menu displayed by pressing MENU on the Squash icon on the icon bar.
The menu items are:
Using Squash from the command line
The Squash module is present as part of the RISC OS operating system and can therefore be used either from the command line or by programs without the Squash application being loaded on the icon bar. The Squash application merely acts as a 'user friendly' desktop front end for the module.
The syntax of the command to compress or decompress a file is:
Squash [-help] [-gzip] <from-file> [<to-file>]
With a single file name the compressed or decompressed version of the file replaces the original. Where a second file name is present the result is written to the second file name file. Note that directories cannot be compressed using this utility.
With both the Squash application and the command line utility, if an attempt is made to compress or decompress a zero length file or the result of a compression is larger than the original (this can happen for very small files) then the original file will simply be copied. If the original file was to be replaced by the output then the original file is left untouched.
Squash file format
Squash adds a header to the compressed data (when using the Squash format). This header is in the form:
4-byte ID: "SQSH" 1-word: length of the original, uncompressed file 1-word: load address of the original file 1-word: execution address of the original file 1-word: reserved (currently always 0)
The load and execution addresses are used to hold the file type and the date stamp of the original file. These are restored when the file is decompressed.
When constructing GZip files, the file format is that of a standard GZip file. An extension area is used in the header to record the load, execution attributes and length of the file. The extension area is in the format:
Offset Length Value 0 2 Length of extended data 2 2 Header identifier (AC) 4 2 Header length 6 4 load address 10 4 exec address 14 4 attributes 18 4 length 22 4 reserved (0) 26 4 reserved (0) 30 4 reserved (0)
Squash can be quit using the normal method. Simply click MENU over the Squash iconbar icon and then click on the Quit option from the menu that is displayed.
This documentation is copyright 3QD Developments Ltd 2013 and may not be reproduced or published in any form without the copyright holder's permission. RISC OS is subject to continuous development and improvement as such all information is provided by 3QD Developments Ltd in good faith and is believed to be correct at the time of publication E&OE. 3QD Developments Ltd cannot accept any liability for any loss or damage arising from the use of any information provided as part of the RISC OS Documentation.
HTML document version r23142 (3rd November 2015)