xFiles disc structure

Low Level View

An xFiles disc is a collection of variable length chunks. Each chunk can
contain a file or a directory or the chunk table. There's only one chunk
table and it's found in chunk number 0. All other disc objects are held in
chunks numbered 1+.

At the start of the disc image appears a header which gives the location of
the chunk directory and certain other morsels of interesting information
about the disc.

So that's it. A header at the start which points to chunk zero. A disc which
contains a number of chunks which can contain files, directories or the
chunk table.

Allocation

When a chunk is about to be extended a quick check of the chunk directory
indicates whether there is space for the chunk to grow in it's current
position. If there isn't the chunk will be moved to the end of the file
where it can grow freely. This naturally leads to fragmentation, so there's
a utility (or at least there will be) to compact the structure. Actually the
safe way would be to copy it all to a new file.
