STScI Logo

rtar softools


NAME rtar -- read TAR format archive file USAGE rtar [ flags ] [ archive ] [ after ] [ files ] PARAMETERS
Advance to the archive file named by the after argument before performing the main operation. The extract or list operation will begin with the file after and continue to the end of the archive.
Output only binary byte stream files. By default, rtar outputs text files in the host system textfile format. The conversion from the byte stream tar format to host textfile format may involve modification of the file, e.g., conversion from ASCII to EBCDIC. A binary extraction copies the file to disk without modification.
Print detailed information about what rtar is doing.
Extract the entire contents of the tape excluding the files or directories listed in files .
-f filename
Rtar uses the first filename argument as the host filename of the archive instead of reading from stdin . Magtape devices should be specified using the host device name, e.g., "/dev/nrmt8" or "MSA0". Since rtar is a host level program and does not read the IRAF tapecap file, IRAF device names such as "mta" cannot be used.
Do not try to resolve file links by a disk to disk file copy. By default, if file A appears in the archive as a link to file B, rtar trys to resolve the link by performing a disk to disk copy of file B to A. This is valid providing file B was present in the archive and has already been extracted. If the l flag is present linked files will not be extracted.
Do not restore the file modify time.
Do not strip trailing blank lines from text files read from the tape. The default is to strip any blank lines at the ends of files. This is necessary when the file was written by wtar on a system like VMS, where the size of the file is not known before it has been read. The wtar utility must guess at the final size and pad the file at the end with spaces to ensure that the size of the file actually written agrees with the file header.
Omit binary files when performing the extraction. A binary file is any file containing ASCII values other than 040 through 0176 (the printable ASCII characters), tab, or newline in the first 512 byte block of the file.
-p pathprefix
When creating directories and files from the pathnames recorded in the archive, omit the given path prefix if it matches the pathname given in the archive. This feature is used to relocate directories, or to read tar archives containing absolute pathnames. For example, given "-p /usr/", the archive pathname "/usr/me/file" would be written to the file "me/file".
The extracted file replaces any existing file of the same name, i.e., rtar performs a delete before creating the extracted file.
The names of the specified files are listed each time they occur on the tape. If no files argument is given, all of the names on the tape are listed.
Do not attempt to restore the owner and group identification of each file.
Print more information about the tape entries than just their names. The verbose file list format gives the file permissions, the link flag (zero if there were no links to the file), the owner and group identification numbers of the file on the system that wrote the archive, the file size in bytes, the date of last modification of the file, and the file name.
The named files are extracted from the tape. If the named file matches a directory whose contents had been written onto the tape, this directory is (recursively) extracted. The owner, modification time, and mode are restored (if possible). If no file argument is given, the entire content of the tape is extracted. Note that if multiple entries specifying the same file are on the tape, the last one overwrites all earlier.
DESCRIPTION Rtar reads multiple files from a UNIX tar format file, restoring the files to disk on the local host machine. Output filenames are mapped according to the IRAF filenaming conventions of the local host operating system.

Rtar 's actions are controlled by the flags argument. Flags consists of a minus sign followed by a string of characters containing any combination of the function flags described below. Other arguments to rtar are the name of the archive file to be read, the name of the file on the archive at which reading is to begin, and the names of the files or directories to be read or to be excluded from the read. In all cases, appearance of a directory name refers to the files and (recursively) subdirectories of that directory.

All rtar filename arguments are IRAF virtual filenames (or host filenames), except the prefix strings, which pertain to the tape format and hence are UNIX pathnames. Magtape devices must be specified using a host physical or logical device name (i.e., IRAF device names like "mta" will not work).

If the input archive file is a tape the blocksize must be a multiple of 512 bytes, with a maximum blocksize of 10240 bytes. Each archived file occupies an integral number of 512 byte blocks in the archive (this is required by the tar format).

Filenames appearing in the file list are interpreted as prefix strings, i.e., a match occurs if the given string is a prefix of an actual filename in the archive. If the last character in the files filename is a $ then an exact match is required (excluding the $ metacharacter). DIAGNOSTICS A file read error occurring while reading the archive file is fatal unless caught and corrected by the host system. File header checksum errors result in skipping of the archive file currently being read, with execution continuing with the next archive file if possible. File write errors on the output file are reported but do not cause termination of rtar . The output file being written will be corrupted.


Since rtar is a bootstrap utility implemented as a foreign task in the CL, it may be called either from within the CL (as in the examples), or at the host system level. The command syntax is identical on both cases.

1. List the contents of the disk archive file "foo.tar".

cl> rtar -tvf foo.tar

2. Unpack the tape archive on unix device /dev/nrmt8 in the current directory.

cl> rtar -xf /dev/nrmt8

3. Unpack the tape archive on the VMS device MSA0: in the current directory.

cl> rtar -xf msa0

When working within the CL, commands such as rewind may be used with rtar , but switching between IRAF and host device names may be confusing. BUGS The current limit on file name length is 100 characters (this restriction is imposed by the standard UNIX tar format). File links are not recreated.


wtar, rmbin

Search Form · STSDAS