User Guide

5-16 Ampex 1308911-02
Model No.
Running Head
dst_format libdd2 API Functions
5.5 dst_format
NAME
dst_format() - format a DD-2 tape.
SYNOPSIS
#include <dd2.h>
int dst_format(int fd, dst_format_st *fmt);
DESCRIPTION
A DD-2 tape must be formatted before it can be used for data storage. See the DST SCSI Tape
Drive DD-2 Tape Format Guide for information on formatting and examples of several
commonly used formats.
Unless the No Re-Formatting (
DST_NO_REFORMAT) interface parameter is set in the device
special file, dst_format() formats unconditionally and does not check whether the target tape
has already been formatted or contains data. Re-formatting a tape invalidates all data written
previously. To check the
DST_NO_REFORMAT interface parameter setting, use the
dst_getparam() function; the interface settings are reported by
dst_param_st.attributes.
dst_format() is available to all users.
PARAMETERS
fd The file descriptor returned by the open call.
*fmt Pointer to a structure of type
dst_format_st.
USAGE
dst_format() uses the *fmt structure for both input and output. On input, the structure
specifies how to format the tape cartridge in the drive. On return, the structure reports the
format read from tape by the drive.
Before calling dst_format(), initialize the *fmt structure with the tape format specification.
The read only members are ignored on input and need not be initialized.
typedef struct
{
u_int flags; /* Flags */
dst_fmt_type_en type; /* Format type */