c_tpwrit - Writes to tape

SYNTAX

#include "tapeio.h"

FUNCTION c_tpwrit (unit, buffer, bufsz, mode)

     long              *unit;
     unsigned char     *buffer;
     long              *bufsz;
     long              *mode;

PARAMETERS

unit (input, integer)

Unit number to be used as a reference for the drive. This number is set by c_tpopen() and should not be altered.

buffer (input, array)

The user's buffer which contains the data that is written to tape.

bufsz (input, integer)

Number of bytes to be written to tape. The maximum number of bytes that can be written is 32K.

mode (input, integer)

A value of HANDLE (1) specifies that when an error occurs the routine is to return an error to the calling program and display a message to the terminal.

DESCRIPTION

The c_tpwrit() call is used to write bufsz bytes to a tape device.

RETURN VALUE

c_tpwrit() returns

     number of bytes actually written
     TAPE_EOT    -->  hardware end of tape
     TPWRIT_SIZE -->  too many or too few bytes requested
     TPWRIT_WRIT -->  device error