OSI/FTAM Programming Guide

HP NonStop OSI/FTAM Programming Guide528612-001
5-1
5
NonStop FTAM Programming
Examples
This section includes two examples that illustrate fundamental FTAM programming
concepts. This section covers these topics:
One example, called excreaf3, reads an FTAM-3 file from a remote system and writes
the contents to a file on the NonStop system; that program is written in the C
programming language. The other example, called extwrif1, creates an FTAM-1 file on
a remote system and writes to it the contents of an edit file on the NonStop system;
that program is written in the TAL programming language. Both source programs are
included in the release subvolume ZOSIFTAM.
Basic Illustrated Principles
Both examples are functionally very simple. Each example operates in wait mode, has
only one active association, operates on only one document type, and performs a full
file transfer. Moreover, the programs do not do any complex error handling; they just
stop if an error arises. What the examples do illustrate are these basic principles of
FTAM programming:
How to include the FTAM API, its procedures and data-structure definitions, in your
application
How to move through the FTAM regimes, and what work is done within each
regime
How you might need to combine FTAM calls with calls to the local (Guardian) file
system
How to assign values to predefined data structures
The OSI/FTAM Programming Reference Manual contains more complex examples,
which demonstrate these additional concepts:
How to use almost all procedure calls, and all optional parameters, defined by the
FTAM API
Topic Page
Basic Illustrated Principles
5-1
Sample Program Structure 5-2
Reading a File: C Programming Example 5-3
Writing a File: TAL Programming Example 5-42