PackDir

Packdir is an archiving tool for RISC OS. It can compress file using an LZW algorithm, or store uncompressed files.

The LZW algorithm is the variant that is used in the ZOO archiver.

Software
The software runs on RISC OS only.


 * Packdir download page

File format
I have reverse engineered the file format.

32bit ints are in LSB format. Strings are NULL-terminated ASCII.

File/directory dates and times are stored in a RISC OS format. They can be converted to a Unix date stamp using the following function: 32bit_int high = (load & 0xff) - 0x33; 32bit int low; low = exec - 0x6e996a00; file_time = high * 42949673 + low / 100; file_time *= 1000;

File format: Header object_entry_1 object_entry_2 ...   object_entry_N

Header: String: "PACK\0" 32bit_int: LZW maxbits - 12

obejct_entry: string: object_name (including trailing NULL) 32bit_int: load (RISC OS load address) 32bit_int: exec (RISC OS exec address) 32bit_int: original_file_length if this object is a file, number_of_child_entries otherwise 32bit_int: attributes (RISC OS read/write permissions) 32bit_int: entry_type: 1 == directory, 2 == file. NB: This field is missing for the first entry in the file - the first entry is always a directory

If the entry is a file, then these fields follow: 32bit_int: Compressed_file_length 32bit_int: Compression_type: -1 == Not compressed, otherwise compressed with LZW. N byetes: archived file data. N == compressed_file_length if compression_type == -1, otherwise original_file_length

Example files

 * earth120.bin
 * MyXCard95A