home *** CD-ROM | disk | FTP | other *** search
-
- tar - tape archive, version 1.1o, written for the Archimedes by
-
- Frank Lancaster, 7-Nov-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.
-
-
- Table of Contents
- -----------------
- 1. Introduction
- 2. Installation
- 3. Usage
- 4. Normal Files As Archives
- 5. Hard Disc Backup
- 6. Compression
- 7. The List File
- 8. UNIX Compatibility
- 9. Raw disc dumping
- 10. History
-
-
- 1. 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. Disk archives in ADFS D/E/L or MS-DOS (double-
- sided, 9 sectors) format dumped to raw disks are supported.
-
-
- 2. Installation
- ---------------
- If you have clib version 3.66, you can use the tar_clib and compr_clib
- versions of tar and compress.
- 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.
-
-
- 3. Usage
- --------
- 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 LENGTH maximum length of extension to use in UNIX file names
- f ARCHIVE read/write archive from file ARCHIVE (mandatory)
- i ignore checksum errors and blocks of zeros (normally EOF)
- l [LIST] read list of files from file LIST or !tarlist as default
- m don't extract file modified time
- p convert '!' in RISC OS names to '.' in UNIX names
- 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 '_'
- F format disk in drive 0 (multiple volumes & E-format only)
- M use multiple volume archiving
- O do not prompt for confimation when formating or overwriting disks
- Q quit immediately if error occurs, do not prompt for action
- S swap extensions in whole path
- T file types appended to names as with RISC-OS NFS
- U UNIX archive (no Archimedes extensions)
- Z convert UNIX '.Z' to '-Z' when extracting
-
-
- 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.
-
-
- 4. Normal Files As Archives
- ---------------------------
- Here the use of tar is identical to the UNIX usage. The file name of an
- archive must always be supplied with the 'f' option. To create an archive
- use the 'c' option:
-
- tar cvf myarc file1 file2 file3
-
- This will create an archive 'myarc' in the current directory which contains
- the files 'file1', 'file2' and 'file3'. I always recommend using the 'v'
- option with every command, this gives more information on what is happening.
-
- You can use path names with the archives and files specified:
-
- tar cvf adfs::4.tmp.myarc adfs::5.file1 adfs::4.src.file2
-
- To list the contents of an archive use the 't' command:
-
- tar tvf myarc
-
- To extract files from an archive use the 'x' command:
-
- tar xvf myarc
-
- This command will extract all files in the archive. If you only want certain
- files, you can specify them after the archive name:
-
- tar xvf myarc file1 file2
-
-
- 5. Hard disc backup
- -------------------
- This actually isn't very different from normal archiving. The main difference
- is that archive files are of course written to floppy discs and that they
- can be split across several discs. The command:
-
- tar cvMf :0.backup :4.*
-
- 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'. They contain a header which supplies identification of the disc
- number so that 'tar' will be able to determine the disc sequence when
- extracting.
-
- It would be better to go to the root directory of the hard disc and to use
- the following command:
-
- tar cvMf :0.backup *
-
- This will store the path names without the drive name, so you could extract
- them onto a different hard disk.
-
- The command:
-
- tar tvf :0.backup
-
- will list the contents of an archive on floppy disc :0. If the archive was
- split across several discs, tar will prompt for further discs when finished
- listing one.
-
- The command:
-
- tar xvf :0.backup
-
- will extract all files on floppy disc :0 in the file 'backup'. If the file,
- which is being extracted, already exists, tar will overwrite it without any
- warning.
-
-
- 6. 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 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
-
- Most compression programmes add a suffix to the compressed file. The UNIX
- compress programme adds '-Z'. If a compression programme that you want to use,
- uses a different suffix, you can set the system variable 'tar$compress$extension'.
-
- 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.
-
- NOTE: The 'z' option is intended for hard disc backups, so that they can be
- compressed while being created. If you are created a normal archive file which
- will not be split, it is more efficient to compress the tar archive after
- it has been created. To do this, use the compress programme:
-
- tar cvf myarc files...
- compress myarc
-
- You will have to decompress the archive before extracting file form it.
-
-
- 7. The 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.
-
-
- 8. 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 UNIX file system doesn't know anything about file
- types, so these will be lost when using the 'U' option. File permissions and
- date stamps are converted to UNIX format (this is always done, even if the
- 'U' option is not used, but tar will save the original RISC OS date stamps
- also if 'U' is not used. UNIX tar programmes which ignore extra information
- in the tar header will be able to process non-UNIX archives).
-
- 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 a file:
-
- RISC OS ---> UNIX: c.test ---> test.c
- UNIX ---> RISC OS: test.c ---> c.test
-
- When converting from RISC OS to UNIX, tar will only regard directories as a file
- name extension if the directory name is shorter than the maximum file name
- extension length. This is 3 by default, but can be set with the 'e' option.
-
- The 'Z' option converts the UNIX '.Z' suffix to a '-Z' suffix as used by the
- compress programme ( test.c.Z -> c.test-Z ).
-
- The 'p' option can be used when creating a UNIX archive to translate a '!' at the
- beginning of a file name to '.'.
-
- NOTE: UNIX tar archives do not support multiple disc archives! They also do not
- support date stamps which are less than 1-Jan-1970.
-
-
- 9. Raw disc dumping
- -------------------
- To transfer files directly via floppy disc to a UNIX machine, you will have to
- create a UNIX archive which is dumped on a raw disc, i.d. a disc that is
- formatted but which will not contain a directory structure. The most common
- disc format is the MS-DOS format (2 sides, 80 tracks, 9 sectors per track).
-
- To create a raw disc archive use the special archive name 'floppy:'. Supply
- the drive number after the colon. For example:
-
- tar cvf floppy:0 files...
-
- will create a raw disc archive in drive 0 on a E/D-format disc.
-
- tar cvf floppy:0M files...
-
- will create a raw disc archive in MS-DOS format.
-
- Disc should be formatted before dumping an archive on them.
-
- On a UNIX machine a typical command to extract an archive from floppy disc
- could be:
-
- tar xvf /dev/rfd0
-
-
- 10. History
- -----------
-
- 1.1o:
- - Acorn tar file type &C46 is now used by default
- - exit code is now 0 not 22 when writing archive
- - tar sprite now for file type &C46
-
- 1.1n
- - extensions were not truncated when extracting from unix archives
- - tar file type is now always used
- - simple tar file sprite included in the distribution
-
- 1.1m
- - severe mess-up when truncating long unix path names corrected,
- first file with directories in name which had to be created was not extracted!
-
- 1.1l
- - new 'X' option, add textual file type as extension in UNIX archives
-
- 1.1k
- - formatting is now done with *adfs:format 0 e y
-
- 1.1j
- - 'Q' option corrected, options are scanned before startup code
- is performed
-
- 1.1i
- - 'T' option now works correctly with file types less than 0x100
-
- 1.1h
- - removed problems with startup-dir and archive on separate discs
-
- 1.1g
- - limit of 77 files in a directory removed
- - programme now exits with Sys$ReturnCode != 0 on user interrupt
- if writing an archive
-
- 1.1f
- - 'Q' option added: non-interactive mode
- - 'T' option added: file type handling like RISC-OS NFS
-
- 1.1e
- - "-C" can now also be used when extracting
-
- 1.1d
- - 'M' option re-introduced, must be used for multiple disc archiving
- - raw disc dumping now should be chosen with 'f' option and 'floppy:'
- archive name
- - prompt for confirmation when using raw disc archives,
- 'O' option disables confirmation
- - improved 'i' option, better defective archive handling
- - when creating UNIX archives, directory to file extension swapping
- will only occur if 's' option is used
- - 'p' option introduced, enables '!' to '.' translation
- - 'F' option introduced, formats floppy in drive 0 to E-format,
- intended for hard-disc backup
- - new system variable tar$compress$extension enables further configuring
- of the compression programme used.
-
- 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'
-