PackDir

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
m (Identification)
Line 5: Line 5:
 
'''PackDir''' is an archiving tool for RISC OS. It can compress file using an [[LZW]] algorithm, or store uncompressed files.
 
'''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.
+
The LZW algorithm is the variant used in the [[ZOO]] archiver, except that the "max bits" parameter is configurable.
  
 
Its [[RISC OS filetype]] is 68E.
 
Its [[RISC OS filetype]] is 68E.
  
 
== File format ==
 
== File format ==
I have reverse engineered the file format.
+
''This section contains reverse-engineered information about the format.''
  
 
32bit ints are in LSB format.  Strings are NULL-terminated ASCII.
 
32bit ints are in LSB format.  Strings are NULL-terminated ASCII.
  
File/directory dates and times are stored in a RISC OS format: The low 8 bits of the "load" address, combined with the "exec" address, are a 40-bit integer representing the number of 0.01-second intervals since the beginning of the year 1900.
+
File/directory dates and times are stored in a RISC OS format: The low 8 bits of the "load" address, combined with the "exec" address, form a 40-bit integer representing the number of 0.01-second intervals since the beginning of the year 1900.
  
 
File format:
 
File format:
Line 33: Line 33:
 
     32bit_int: original_file_length if this object is a file, number_of_child_entries otherwise
 
     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: 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
+
     32bit_int: entry_type: 1 == directory, 0 == 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:
 
If the entry is a file, then these fields follow:
     32bit_int: Compressed_file_length
+
     32bit_int: Compressed_file_length or special code - If this field is -1 the file is not compressed,
    32bit_int: Compression_type: -1 == Not compressed, otherwise compressed with LZW.
+
              otherwise compressed with LZW.
     N bytes: archived file data.  N == compressed_file_length if compression_type == -1, otherwise original_file_length
+
     N bytes: archived file data.  N == compressed_file_length if file is compressed, otherwise original_file_length
  
 
== Identification ==
 
== Identification ==

Revision as of 21:04, 11 February 2019

File Format
Name PackDir
Ontology

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 used in the ZOO archiver, except that the "max bits" parameter is configurable.

Its RISC OS filetype is 68E.

Contents

File format

This section contains reverse-engineered information about the format.

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

File/directory dates and times are stored in a RISC OS format: The low 8 bits of the "load" address, combined with the "exec" address, form a 40-bit integer representing the number of 0.01-second intervals since the beginning of the year 1900.

File format:

   Header
   object_entry_1
   object_entry_2
   ...
   object_entry_N

Header:

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

object_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, 0 == 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 or special code - If this field is -1 the file is not compressed,
              otherwise compressed with LZW.
   N bytes: archived file data.  N == compressed_file_length if file is compressed, otherwise original_file_length

Identification

Files begin with "PACK", followed by 0x00. Note that this is not enough to distinguish them from Git pack format.

Software

Example files

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox