Alternate Entry Name: IO_PERR
B: io.perr( unit [, prefix] );
C: #include <stdio.h> void io_perr(FILE *unit [, const char *prefix]);
IO.PERR outputs the error message currently associated with "unit", if any. The message is written to the standard error unit. If no error is associated with the unit, IO.PERR returns without doing anything.
In order for IO.PERR to be relevant, you must specify the "e" (error recovery) option when you open "unit". Otherwise, if an error occurs on the unit during an I/O operation, the program simply issues an error message and terminates. If you have opened the unit with "e" and an I/O error occurs later on, you can use IO.PERR to output the same message that the program would have issued if you did not specify "e".
The "prefix" is added on the beginning of the message that IO.PERR outputs. For example,
io.perr(u, "CMDNAME: ");
outputs a message of the form
CMDNAME: error message
Copyright © 1996, Thinkage Ltd.