Archive files

From BeebWiki
Revision as of 00:48, 3 November 2023 by Jgharston (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Archive files are files that contain the content of other files. They are a useful method of holding, moving and copying multiple files without having to deal with each and every individual file itself. They usually also contain metadata relating to those files, so being a useful method of being able to transport that metadata when the storage medium itself cannot hold it.

Archive file formats

Archive files typically used with Acorn systems are GetBack, Black, CJR and ZIP files.

GetBack

Written by Acorn as a tool to back up file server contents, implemented with an archiver called Archive and a dearchiver called GetBack.

 The format of an Acorn GetBack archive is as follows
  Repeated for each file:
     n bytes : filename, <cr>
     1 byte  : filetype - 1=file, 2=directory
     1 byte  : disk number - starts at 1
     4 bytes : load address
     4 bytes : exec address
     4 bytes : length - should be ignored if filetype=2
     1 byte  : access byte
     2 bytes : modification date in NetFS format
     2 bytes : modification time hh, mm (no seconds)
     length x bytes of file data
 
 Stored filenames are the full path of the entry, often with an absolute
 directory reference, eg "$.CAVE", "$.CAVE.!BOOT". If the stored filename
 starts with '.', the initial '.' is skipped.
 
 Entries can be in any order, but will tend to be in the order that they
 were encounted when adding them to the archive.

Black

Originally designed by Andrew Black in 1991, implemented with an archiver/dearchive program called Archive.

 The format of a Black archive is as follows
 A version 2 Black archive starts with a 'dummy' header to prevent
 earlier versions from extracting incorrectly:
   Read using INPUT#
    0000 "" - ie, null string, ie 00, 00
    0002 ( filelength-17 ) OR &FF000000
    0007 dummy load% - set to zero
    000C dummy exec% - set to zero
    0011 rest of file starts here
   
  Repeated for each file:
   Read using INPUT#:
    name$  Filename
    len%   length
    load%  load address
    exec%  execute address
  Version 2 archives then have:
    attr%  file attributes
   Read using BGET:
    The bytes of the file
 
 Archive version before 2.10 will read a version 2 archive file as a single
 entry with the flag set to 'ignore this data'. Archive version 2.10 onwards
 can read version 1 archive files and version 2 archive files.

CJR

Originally written by Chris Richardson at 8BS. It has a fixed-sized header containing a list of up to 51 files, so

 The format of a CJR archive is as follows
   Read using INPUT#:
    0000 ptr%(0) \
    0005 ptr%(1)  \
    000A ptr%(2)   } Pointers to entries
     :            /
    00FA ptr%(50)/
    00FF
  Each entry:
   Read using INPUT#:
    name$  filename
    load%  load address
    exec%  execution address
    len%   file length
    attr%  file attributes
   Read using BGET:
    The bytes of the file
 
 If a pointer is zero, it doesn't point to anything. Usually, the files run
 straight after each other. Current versions of Archive cannot cope with
 null pointers in the middle of the pointer list.
 
 With Black and CJR archives the bottom three bytes of len% is the actual
 data length occupied within the archive, even if this data expands to form
 a larger file. The top byte of len% is a flag. Current meanings are as
 follows:
   &00    File
   <>&00  Not a file
   &FF    Ignore this data

ZIP

Disk images

Disk images are sometimes used as archive files, particularly images of a single DFS filesystem.

See also

Jgharston (talk) 00:27, 26 March 2022 (CET)