mtio(7) mtio(7)NAME mtio - interface for magnetic tape devices DESCRIPTION The mtio interface gives applications access to tape devices through a standard interface. While general read, write, and seek operations are part of the standard I/O library, additional resources are required to support tape devices. The mtio interface provides a fairly device-independent way to perform additional operations, such as rewinding, that are common to tape drives but not common to other types of devices. One feature of the mtio interface is that it reads and writes only in terms of the appropriate block size for the tape device. This ``blocking'' of data is a requirement for minidatacartridge drives such as the Apple Tape Backup 40SC (but not DDS-DC DAT drives). To ensure that data is properly blocked for minidatacartridge drives, use the tcb filter (see tcb(1), dd(1), and tc(7)). The mtio interface moderates device I/O when output is sent to or obtained from the tape device files in /dev/rmt. I/O Controls When you manipulate the tape cartridge device directly through your own programs or through programs such as mt, tape-specific operations are supported through mtio I/O controls (ioctls). With a few exceptions, these generic operations are shared by all tape drives. One exception is the ``format'' ioctl (MTFORMAT), which is available for the Apple Tape Backup 40SC and DDS-DC DAT drives; in general, MTFORMAT is not useful for reel tape drives, such as nine- track tape drives. Other peculiarities of minidatacartridge drives are described in tc(7). The following is a list of mtio ioctls and their associated subcommands. For complete details about the data structures, see <sys/mtio.h>. ioctl(fildes, MTIOCGET, *mtget) This tape ioctl causes the tape unit to return the status of the tape drive in mtget. ioctl(fildes, MTIOCTOP, *mtop) This tape ioctl causes the tape unit to perform the subcommand selected by the current values stored in the structure mtop. Here are the subcommands for MTIOCTOP: MTWEOF Writes an end-of-file record. March 1993 1
mtio(7) mtio(7)MTFSF Moves the tape media forward one file. MTBSF Moves the tape media backward one file. MTFSR Moves the tape media forward one record. MTBSR Moves the tape media backward one record. MTREW Rewinds the tape. MTOFFL Rewinds the tape and puts the drive offline. MTNOP Sets status, but performs no operation. FILES /dev/rmt/* Raw magnetic tape device files /usr/lib/sys/ioctl.h Header file /usr/lib/sys/mtio.h Header file SEE ALSO tc(7) mt(1), tar(1), tcb(1), tp(1) in A/UX Command Reference 2 March 1993