IO.PERR - issue error message for I/O unit.

Alternate Entry Name: IO_PERR

Usage:

B:
   io.perr( unit [, prefix] );
C:
   #include <stdio.h>
   void io_perr(FILE *unit [, const char *prefix]);

Where:

unit
refers to an open I/O unit. This can be a unit number or a FILE* pointer.
prefix
is a string to be printed before the message that IO.PERR generates.

Description:

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

See Also:

expl b lib io.err

Copyright © 1996, Thinkage Ltd.