.\" @(#)perror.3f 1.3 86/01/02 SMI; from UCB 4.2 .TH PERROR 3F "98/09/16" .SH NAME perror, gerror, ierrno \- get system error messages .SH DESCRIPTION .\" .IX perror "" \fLperror\fP .IX gerror "" \fLgerror\fP .IX ierrno "" \fLierrno\fP .IX "error messages" .IX "error id number" .\" .B perror \(em write a message to FORTRAN logical unit 0 .br .in +5 The message is for the last detected system error. .br .I string is a character input argument. .br It is written preceding the standard error message. .sp .in -2 Example 1: .BR perror : .in +2 .nf .ft 3 ... CALL perror ( "file is for formated I/O" ) ... .ft 1 .in -5 .fi .\" .PP .B gerror \(em return system error message .in +5 .br .I string is a character output argument. .sp .in -2 Example 2: .BR gerror , used as a subroutine: .in +2 .sp .2 .nf .ft 3 CHARACTER string*30 ... CALL gerror ( string ) WRITE(*,*) string END .ft 1 .in -2 .fi .sp Example 3: .BR gerror , used as a function; in this case, .I string is not used: .in +2 .sp .2 .nf .ft 3 CHARACTER gerror*30, z*30 ... z = gerror( ) WRITE(*,*) z END .ft 1 .in -5 .fi .PP .B ierrno \(em return the error number of the last detected system error .in +5 .sp This number is updated only when an error actually occurs. Most routines and I/O statements that might generate such errors return an error code after the call; that value is a more reliable indicator of what caused the error condition. .sp .in -2 Example 4: .BR ierrno : .in +2 .sp .2 .nf .ft 3 INTEGER ierrno, n ... n = ierrno ( ) WRITE(*,*) n END .ft 1 .in -2 .fi .\" .SH FILES .\" .B libF77.a .SH "SEE ALSO" .BR intro (2), .BR perror (3) .\" .SH RESTRICTIONS .\" .I string in the call to .B perror cannot be longer than 127 characters. .PP The length of the string returned by .B gerror is determined by the calling program. .\" .SH NOTES .\" If the error code is greater than or equal to 1000, it is a .B f77 I/O error. .PP If the error code is less than 1000, it is a system error. See .BR intro (2). .PP The .B f77 I/O error codes and their meanings are: .sp .in +5 1000 error in format .br 1001 illegal unit number .br 1002 formatted io not allowed .br 1003 unformatted io not allowed .br 1004 direct io not allowed .br 1005 sequential io not allowed .br 1006 can't backspace file .br 1007 off beginning of record .br 1008 can't stat file .br 1009 no * after repeat count .br 1010 off end of record .br 1011 .br 1012 incomprehensible list input .br 1013 out of free space .br 1014 unit not connected .br 1015 read unexpected character .br 1016 illegal logical input field .br 1017 'new' file exists .br 1018 can't find 'old' file .br 1019 unknown system error .br 1020 requires seek ability .br 1021 illegal argument .br 1022 negative repeat count .br 1023 illegal operation for unit .br 1024 .br 1025 incompatible specifiers in open .br 1026 illegal input for namelist .br 1027 error in .B FILEOPT parameter