Version 6 of trofs

Updated 2005-03-26 21:28:32 by jcw

See http://math.nist.gov/~DPorter/tcltk/trofs/


Tcl package that provides commands to create, mount, and unmount archives containing read-only filesystems.


File format (version 1, as found in trofs-0.4.3)

(reconstructed from trofs-0.4.3/library/procs.tcl by PS)

The trofs archive file format is a concatenation of files bundled in directories, where each directory contains file, link and directory TOC entries which point to an absolute location in the archive file and specify the length of the item in the file. All offsets are from the start of the archive file. Each toc is a utf-8 encoded dict

 <arbitrary header (optional)>
 0x1a
 <file1 data>
 <file2 data>
 <file3 data>
 <dir1/file1 data>
 <dir1/file2 data>
 <dir1/dirA/file1 data>
 <dir1/dirA TOC>
 <dir1 TOC>
 <dir2/file1 data>
 <dir2 TOC>
 <root TOC>
 0x1a
 trofs01 (literal string - trofs file signature)
 <size of root TOC (big endian 32-bit int)> 
  • Arbitrary header: For example, a Tcl script for mounting the trofs file as a Tcl Module.
  • File data: A verbatim copy of the contents of the file
  • root/dir TOC: a dict of filenames (see example below)
  • size of root toc: Helps point to the root toc: filesize-12-rootTocSize

TOC:

 file1 {F <length> <offset>}
 file2 {F 15 32}
 dir1 {D <size> <offset>}
 dir2 {D 203 12542}
 link1 {L <target>}
 link2 {L ../file1}

What is the reason for inventing Yet Another Archive Format And Making It Tcl Specific, and not using - say - ZIP? -jcw


Category Package