gtpc2mig | C/C++ Language Support User's Guide |
When an application wants to write a record or set of records to an
external device, do the following:
- Issue a TPFxd_archiveStart request to obtain a token which will
be used on all subsequent TPFxd_ functions.
- Allocate storage for a TPFxd_locationmap (see the
c$tpxd.h header file for the size of that item).
- Issue a TPFxd_open request. This will update
the TPFxd_locationmap allocated in step 2, this information should be preserved because it will be
required to retrieve the data at a later point in time.
- Issue either a TPFxd_write or a TPFxd_writeBlock
request, depending on whether the data is in heap storage or within a TPF data
level.
- Repeat the write requests until all the data that is intended to be
together has been written.
- Issue a TPFxd_close request to ensure that the data
has been written to the external device.
- Repeat steps 2 through steps 6 for any additional groups of data that need
to be written.
- Issue a TPFxd_archiveEnd request. This will close and
dismount the tape that was mounted in step 3.