gtpc2m8s | C/C++ Language Support User's Guide |
This function causes an assigned general tape to be rewound. For
multi-volume tape sets, an option may be specified to either rewind the
current volume or fallback to the first record of the first volume.
Control does not return to the caller until the operation is complete.
Format
#include <tpftape.h>
int trewc(const char *name, int fallback);
- name
- This argument is a pointer to type char, which must be a
3-character string identifying the tape to be rewound. This function
can only be called for a general tape.
- fallback
- This argument applies when operating a multi-volume tape file. If
FALLBACK is specified, the previous volume is mounted when load
point is reached on the current volume. If NO_FALLBACK is
specified, rewinding stops at the load point with no fallback to the previous
volume.
Normal Return
Integer value of zero indicating successful completion.
Error Return
The nonzero integer value in CE1SUG is returned to the caller.
Programming Considerations
- This function calls the equivalent of waitc. To ensure
consistent results it is recommended that an explicit waitc
function be coded before the call to trewc to ensure that errors
for other I/O operations are not reflected in the function return
value.
- The tape being rewound must be assigned to the issuing ECB.
Examples
The following example rewinds the current physical volume of the VPH
tape.
#include <tpftape.h>
·
·
·
waitc()
trewc("VPH",NO_FALLBACK);
Related Information