Open System Services Programmer's Guide

Tape I/O
The OSS environment has no programmatic access to tapes. To access tapes in the OSS environment
you must use the pax utility. You can, however, use Guardian procedures to write OSS files and
output directly to tape and read them directly from tape.
Tape I/O With pax
The pax utility reads, writes, and lists files and directories to and from archive files. An archive
file can be a disk or tape file. You can use the pax utility from a C program by invoking it with
the popen() function. For information about the pax utility, refer to the pax(1) reference page
either online or in the Open System Services Shell and Utilities Reference Manual.
Example 48 (page 209) shows how to use the pax utility from a program. It reads the names of
files to be backed up from the user's terminal input and passes the list of files to the pax utility
using popen().
NOTE: Normally, you or system operators read from and write to tape archives using commands
and utilities from the command line prompt or shell scripts. This example shows how you can
accomplish the same task programmatically, even though it might be unusual to do so.
208 Managing I/O