FTAM/9000 Programmer's Guide

Chapter 8 313
Transferring HP FTAM/9000 Data
Reading Data
Reading Data
Use ft_read() to identify what you want to read. To receive the identified
information from the responder, call ft_rdata() to tell ftam_init the
number of data elements you want to receive. The ftam_init gathers and
returns the information requested.
ft_read()
#include %</opt/ftam/include/map.h>
#include %</opt/ftam/include/mapftam.h>
Return_code
ft_read (connection_id, fadu_identity, access_context,
return_event_name, input_dcb, inout_dcb)
Connection_id connection_id;
struct Ft_fadu_identity fadu_identity;
enum Ft_access_context access_context;
Local_event_name return_event_name;
char *input_dcb;
struct Ft_read_out_dcb **inout_dcb;
Use ft_read() to identify the FADUs you want to read and to request that
data be sent. Remember, FADUs may contain structure and data. Since
FTAM-1, FTAM-3, and NBS-9 file type files contain only single FADUs,
you must read the entire file. You can read individual FADUs within
FTAM- 2 files. (Refer to the “HP-UX FTAM Overview” chapter for a
description of FADUs. Refer to the “FTAM Data Structures” chapter for
information on Ft_fadu_identity.)
Invoke ft_read() in the File Open regime to move to the Data Transfer
regime.
During ft_connect(), you must negotiate the FT_FU_READ
functional_units to use ft_read().
During ft_create() and ft_select(), you must request FT_FA_READ in
requested_access.
The ft_read() input_dcb parameter does not contain information;
therefore, pass a NULL pointer for the input_dcb parameter.
To read an FTAM-1, FTAM-3, INTAP-1, or NBS-9 file, set
fadu_identity of FT_FIRST. To read an entire FTAM-2 file, set
fadu_identity to FT_BEGIN. To read a FADU within an FTAM-2 file,
set fadu_identity to FT_FIRST or FT_NEXT.