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] 0x1a 0x1a trofs01 (literal string - trofs file signature) * ''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 } file2 {F 15 32} dir1 {D } dir2 {D 203 12542} link1 {L } link2 {L ../file1} ''What is the reason for inventing Yet Another Archive Format And Making It Tcl Specific, and not using - say - ZIP? -[jcw]'' [PWQ] ''27 Mar 05'', I would go one further. Since the FS is to be read only, why don't you adopt '''ext2-fs''' or '''dos-fs''', or even '''cram-fs'''. The advantages of these is that you can mount these under linux and create/modify them easily. When you re-invent the ''wheel'', it should be a better wheel. ''Would makes no sense on Windows -[jcw]'' Jcw: Hence the dos-fs option. I would rephrase ''Windows makes no sense'' [PWQ]. [PS] ''27Mar05'' The short answer I got from dgp was that it is open for discussion. The main reason for me writing this format down here is to familiarize myself with the trofs code. As far as I can tell, a lot of effort went into making the trofs code thread safe. The next step will be adding compression to trofs, and after that I am likely to hack it to read (a subset of) zipfiles. The significant difference between the zip file format and trofs file format is the directory stucture. In zipfiles, a main TOC holds all files, trofs has a toc for each directory. I think the simplest trick will be to turn the zip TOC into a nested [dict], that would preserve most of the trofs internals. [SEH] 28Mar05 -- If you were to use the Debian .deb format, then you would get the benefit of re-use, and to boot every existing Debian package could be trivially converted to a Tcl module. Then Tcl could be used as a general-purpose software/install management tool, rather than simply a Tcl package tool. I dream of using Debian-style archives on Windows as well as Unix. That would be another opportunity to widen the appeal and use of Tcl in the computer-user community. 30Mar05 -- The tar virtual filesystem included in the Tclvfs package has pure-Tcl code for reading from standard tar files. So why not simply use the tar format for your filesystem and adapt the existing code, or better yet use the tar vfs? '''[DGP]''' One of the main motivations was to write code that provided a '''Tcl_Filesystem''' that did not make use of the '''tclvfs''' package. This was in part to prove that the '''Tcl_Filesystem''' interface was usable by someone other than the person who wrote it, and in part to avoid some (perceived?) limitations imposed by the '''tclvfs''' package itself. In particular, I believe that the scheme '''tclvfs''' uses to determine what paths belong to what filesystem is entirely prefix based, which prevents nested mounts. trofs does not have that limitation. Regarding the archive format suggestions, I've never thought the archive format was the point. I actively don't care what the format is. Completely open to changing it, so long as doing so actually provides some benefit. ---- [Category Deployment] | [Category Package]