tar - tape archive, version 1.1a, written for the Archimedes by Frank Lancaster, 7-Jan-1991 Bug reports and comments may be sent as e-mail to: fl@tools.uucp Paper Mail: Frank Lancaster Tools GmbH Kessenicher Str. 108 W-5300 Bonn 1 Federal Republic of Germany This programme is public domain. You may copy it freely, provided you do not charge ANYTHING for its distribution. Introduction ------------ This version of tar is derived from the UNIX tar utility. Its main use is as a hard disk backup programme. It also comes in very handy when transferring files from or to UNIX. The name "tape archive" is misleading but historical. On the Archimedes archives are ordinary files on any file-system (adfs, scsi, dosfs, etc.). Multiple disc archives are supported, now also as ordinary files. For backward-compatability multiple disk archives in ADFS D/E/L or MS-DOS (double-sided, 9 sectors) format dumped to the raw disks are still supported. This will be dropped in future versions. Installation ------------ Before using the programme set the system variable "tar$scrap" to the name of a temporary scrap file which should only be used by tar, for example "adfs::4.$.tmp.scrap". The leaf name must not be longer than 8 characters, another 2 ("-Z") are added if compression is used. This file will only be used if compression is enabled. If compression is used tar requires the compress programme (included in this distribution), which handles compression and decompression. Normally this should be accessable via the system variable Run$Path, but you can customize the compression and decompression commands with the two system variables tar$compress and tar$decompress (see below "compression"). The system variable tar$filetype is used as file type for tar files. If it is not set, file type FFD (data) is used. Use --- The programme should be called from the command line interpreter as it requires parameters. tar [-]Commands[Options] ARCHIVE [LIST] [BLKS] [LEN] [-C DIR] file1 file2 ... Commands: c create a new archive r append files to end of archive t list the contents of an archive x extract files from an archive Options: b BLKS blocking factor BLKS (block size = BLKS x 512 bytes) e LEN maximum extension length to use in UNIX file names f ARCHIVE read/write archive from file ARCHIVE i ignore blocks of zeros in the archive, normally EOF l [LIST] read list of files from file LIST or !tarlist as default m don't extract file modified time s swap extension in filename v verbosely list what files we process w ask for confirmation z run files through compress B reblock as we read C DIR change to directory DIR E '.' in UNIX names will be converted to '_' M disable multiple volume archiving O use single-disk archive * S swap extensions in whole path U UNIX archive (no Archimedes extensions) Z convert UNIX '.Z' to '-Z' when extracting Obsolete options for backward compatability (used for raw-disk archives): # [0-3][DELM] specify drive and density Items marked with a '*' are not yet implemented, items marked with a '#' will be dropped in future versions. You must specify an archive file on the command line with the 'f' option. The path names of the archived files are stored as specified on the command line. Using the 'v' (verbose) option will list the path names stored as the archive is created. Normally you shouldn't specify the absolute path names, as you may want to extract the files to an other directory. Examples: tar cvf :0.backup :4.* This will backup all files on the hard disk :4 onto floppy disk :0 in the file 'backup'. If the archive requires more than one floppy disc, you will be prompted for more discs, which will contain further files also called 'backup'. It would be better to go to the root directory of the hard disc and to use the following command: tar cvf :0.backup * This will store the path names without the drive name, so you could extract them onto a different hard disk. tar tvf :1.backup This will list the contents of an archive on floppy disc :1. tar xvfb :0.backup 160 This will extract all files on floppy disc :0 in the file 'backup' using a buffer of 80KBytes. The blocking factor is 10KBytes default, but with more memory you can speedup operations by using a larger factor. If multiple discs were used for the backup, you will be prompted to insert the next disc after a disc has been processed. The tar list file ----------------- The command: tar l tarlist will read file names and options from the file 'tarlist' instead of the command line, if any file names are given they will be ignored, options on the command line are overridden by options specified in the 'tarlist' file. The 'tarlist' file may contain empty lines, which are ignored, lines with one file name, and lines starting with a period followed by one command or option or a blank and a comment. For example: . tar archive definition file (this is a comment, note blank after the period) .c create command (stuff after .c is ignored) .v verbose option (stuff after .v is ignored) .f :0.backup (archive file name) .z compress option ( " ) .b 400 blocking factor (stuff after 400 is ignored) . file names follow !Boot Apps.* Games.* This example file can be found in the distributed tar archive. If no list file name is given on the command line '!tarlist' will be used as default. Compression ----------- With the 'z' option files can be compressed before being written to an archive. For compression the standard UNIX utility compress is used, also supplied with the tar programme. The system variable tar$scrap is used for temporary storage. If you are backing up a complete hard disc and have enough memory you should use a RAM disc for the scrap file, and the compress programme should also be copied onto the RAM disc. You can also use different programmes for compression and decompression if you set the tar$compress and tar$decompress system variables. The default settings are: tar$compress compress < %1 > %2 tar$decompress compress -d < %1 > %2 When writing a file 'TresImp' to an archive the compress command will expand to: compress < TresImp > Scrap-Z The %1 parameter is substituted with the file name and %2 is substituted with the scrap file name. The decompress command, when extracting the file, will expand to: compress -d < Scrap-Z > TresImp So if you have a compression programme 'squash' and a decompression programme 'expand', which take two parameters and don't use I/O redirection, set the variables to: tar$compress squash %1 %2 tar$decompress expand %1 %2 You can also specify absolute paths in these variables, e.g. when the compression programme is on the RAM disc: tar$compress ram:$.compress < %1 > %2 tar$decompress ram:$.compress -d < %1 > %2 Compressed files are automatically detected when extracting. A verbose listing of the archive also shows the compression percentage. UNIX Compatibility ------------------ Another main use of the tar programme is as a file transfer programme between UNIX and RISC OS. Archives created with the 'U' option can be processed by UNIX tar programmes. The RISC OS version of tar detects UNIX tar archives and converts file names to adfs. The 's' option can be used to swap the extension of an file in front of its file name ( test.c --> c.test ). The 'Z' option converts the UNIX '.Z' suffix to a '-Z' suffix as used by the compress programme ( test.c.Z -> c.test-Z ). Note: UNIX tar archives do not support multiple disc archives! History ------- 1.1a - first release to 'comp.sys.acorn' Now I can feel what international means... (A tip of the magical hat to all Rush fans) - multiple disc archiving changed, now consistent with normal use; archives on multiple floppy discs are now ordinary files and are split into several files on different discs; main problem was writing a filing-system independent free-space routine (not all filing systems are FileCore based!) - tar$filetype introduced; when set use value as FileType for tar files, maybe Acorn could supply a tar file type; this would be mandatory for a desktop version - dangerous bug with tar$scrap set to directory removed; used to delete directory recursively, now produces error message - bug when extracting directories 'bad file name' removed - tar$scrap now only has to be set when using compression 1.0o - RISC OS to UNIX file name conversion introduced directory names may be converted to extensions, '!' to '.', '/' to '_' - new list file default '!tarlist' - compress now called with I/O redirection, saves disk space and I/O access time 1.0n - UNIX/RISC-OS time conversion rewritten: FP eliminated, minor deviations corrected, over-/underflow check - FSVars module no longer required 1.0l-m - system variable for compression scrap file tar$scrap - system variables for compression and decompression commands tar$compress, tar$decompress 1.0h-i - fixed more bugs with 's' option and introduced 'Z' option 1.0g - fixed bug with 's' option 1.0f - the 'r' option is now implemented - the 'L' type discs are now implemented - the 'M' option was dropped, multiple disk archives are now default expect if writing a UNIX archive, or 'O' option is used - new 'l' option introduced, files and options can now be specified in a LIST file - tar now prompts for 'discs' not 'volumes' 1.0e - first release into the public domain in 'eunet.micro.acorn'