ROOT Chunk

See more on Chunks in general.

An Instance of ROOT corresponds with an Instance of INDX, and supplements it. The value in the Payload of ROOT is an absolute file path that specifies where the files originally came from, or otherwise where they should be extracted to.

ROOT Chunk structure

Flags

The Flags are all used in the general manner. Specifically, r (range of instances) , p (multi-part) & c, and y (payload specification) flags are all available. The i (instance sizes field is present) flag must be set whenever r is set.

The b (subtype) flag is set when the Subtype is present (see below).

Subtype

The Subtype matches the corresponding INDX chunk that this applies to. Only the main index, per-part indices, and supplimental indeces may have ROOTs, so the Subtype must be one of those values.

Instance Number

The Instance Number matches the corresponding INDX chunk that this applies to.

ROOT Chunk Payload

The Payload contains a file path, either as an absolute path or starting with a Substitution Code.

The value in ROOT may be specified using the actual syntax for the filesystem noted in the corresponding INDX. This allows things that cannot be represented in the abstracted simple tree structure. For example, drive letters and UNC names for DOS and Windows file systems can be used. However, the control codes as used with INDX file names may be used also, so this value could be file-system independent if there is no need for file-system specific features.

Substitution Codes

In addition, substitutions are made in this string, so it may specified a logical location without knowing its actual name. For example “the temp directory”, or “the home directory” or “the system directory”.

The substitution codes are specified by one of the words listed below (case sensitive), surrounded by a pair of hex 1A (SUB) characters. For example (to use C string literal syntax), "\x1aTEMP\x1a\x1cMydir" specifies the Mydir subdirectory in the “temp” directory, whatever that may be.

codemeaning
homeThe “home” directory.
ProgramFilesThe place under which programs are installed. Corresponds to the “Program Files” directory under Windows, and the /usr/bin directory under Unix.
tempThe directory for temporary files.
Windows(Windows systems) The Windows directory. This is returned by the GetWindowsDirectory API function.
WindowsSystem(Windows systems) This is returned by the GetSystemDirectory API function.
∴Add to this: what are all the interesting places on each supported operating system? Also, someone who works on Unix needs to check my statements here.

Usage Notes

When absolute paths are needed (perhaps the archive represents a backup), don’t put absolute paths into the INDX. Instead, the paths in INDX are relative to a starting point, normally specified upon extraction. The value in ROOT is a suggested default for extraction.

Examples


Valid HTML 4.01!

Page content copyright 2003 by John M. Dlugosz. Home:http://www.dlugosz.com, email:mailto:john@dlugosz.com