gtpc2migC/C++ Language Support User's Guide

Writing Records

When an application wants to write a record or set of records to an external device, do the following:

  1. Issue a TPFxd_archiveStart request to obtain a token which will be used on all subsequent TPFxd_ functions.
  2. Allocate storage for a TPFxd_locationmap (see the c$tpxd.h header file for the size of that item).
  3. 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.
  4. 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.
  5. Repeat the write requests until all the data that is intended to be together has been written.
  6. Issue a TPFxd_close request to ensure that the data has been written to the external device.
  7. Repeat steps 2 through steps 6 for any additional groups of data that need to be written.
  8. Issue a TPFxd_archiveEnd request. This will close and dismount the tape that was mounted in step 3.