User Guide

5-54 Ampex 1308911-02
Model No.
Running Head
dst_setpos libdd2 API Functions
5.17 dst_setpos
NAME
dst_setpos() - set tape drive position to the specified location.
SYNOPSIS
#include <dd2.h>
int dst_setpos(int fd, dst_position_st *pos);
DESCRIPTION
dst_setpos() positions the tape drive to the specified location. This is the data block address
at which the next read or write operation occurs, and is often referred to as the current
position. Initiating a write operation at any position other than end of data (EOD), invalidates
all data in the partition that was written previously to locations beyond the current position.
A position can be expressed in either portable token form or standard C structure form, as
described in “DST API Overview” on page 5-1. You can also specify a partial position as
described below.
dst_setpos() is available to all users.
PARAMETERS
fd The file descriptor returned by the open call.
*pos Pointer to a structure of type
dst_position_st.
USAGE
dst_setpos() uses the *pos structure for input only; see “DST API Overview” on page 5-1 for
details. Before calling dst_setpos:
Initialize the pos member with a position specification that indicates the location you
want the drive to position to.
Initialize the type member with the definition of the position structure.
typedef struct
{
dst_pos_type_en type; /* Position type */
dst_position_un pos; /* Position */
} dst_position_st;