Update info on the f77 I/O library 6 June, 1985 In order of fix (not in reverse order) 01 Feb, 1980 All instances of: if(!init) f_init(); have been removed. f_init() is called from main.c on startup in the new libF77.a . 01 Feb, 1980 Backspace now allows non-seek files to reset the EOF flag. 20 Mar, 1980 The way SIGINT is handled in libF77/main.c has been changed. If the signal is not SIG_DFL, it is left alone as otherwise the program will be killed if run in the background and the user types DEL. The signal trap that used to be in the I/O lib has been removed. 20 Mar, 1980 The ANSI fortran standard requires that I/O routines return to the caller on any error condition if iostat= is specified even if no err= or end= trap is specified. The implication of this is that the program must be prepared to deal with ALL I/O errors if iostat= is specified. If only one trap is specified, end= for example, the program must test the iostat variable for positive/non-zero after the I/O call since return will occur on any error. This seems awkward and I've chosen to make this feature optional. I am interested in other views on this. In the current version of the compiler (using the modified io.c), iostat= is used only to return status information from I/O calls but does not itself cause return on any I/O error. Only the traps, err= and end=, will cause a return/branch, and only for the specified trap(s). This feature has been made a compile time option in the current version of (modified) io.c It implements the standard correctly if compiled with -DKOSHER or -DIOSRETURN. Otherwise it executes as currently implemented. 18 Apr, 1980 As originally implemented the '$' specification caused a NULL to be output (inplace of the \n) Actually NULL's should never appear in the formatted output streams. Therefore in "sfe.c" in x_putc() and pr_put() add if (c) before the instances of putc(c,cf) 12 May, 1980 Spaces (ASCII 040) do not have significance in FORMAT statements except within strings. In order to accomodate old programs that may have arbitrary occurances of spaces, all spaces are now ignored. Thus the format ( 1 0 X , 1 2 F 1 0 . 4 / ) is accepted. 12 May, 1980 A bug in handling partially filled "unformatted direct" records has been fixed by ensuring that all records are complete when written. The bug was that the last record of such a file would cause EOF if a read was attempted for a full record. Existing files of this form should be "fixed" by reading and rewriting the last record using the new version of libI77.a 12 May, 1980 BACKSPACE will now open a default file (fort.N) if the specified logical unit is not open. REWIND and other I/O already did this. CLOSE and ENDFILE do not open a default file. ?? November, 1980 The modified io.c no longer supported. SIF feels it should conform exactly with the standard. This means that iostat= will cause return in all cases, regardless of the presence or absence of err= or end=. ?? February, 1981 Backspace will reset EOF on any unit, even if it can't "seek". You still can't "rewind" non-seekable units. 25 March, 1981 There is now a f77 I/O error list available in the lib. libU77.a routines use it. All error numbers have symbollic values. 18 April, 1981 Zero fill can be forced on output of true zero by the BZ format control. 28 April, 1981 It is now possible to read into a hollerith field in a format string. This is not encouraged! 8 May, 1981 There is a pseudo-lib to force ANSI-fortran-66 I/O to logical unit 6: carriage control will be interpreted, and blanks will be '0's. Include -lI66 on the command line. 8 May, 1981 The error report will show non-graphic chars as ^X a la vi. 11 August, 1981 SFE read with a null list at EOF now takes the error branch. All routines check the return value of 'nowreading/nowwriting'; this should fix the bug causing infinite looping on close of a write protected file on which writing had been attempted (it will take the err= branch, if any) 6 December, 1981 t_runc now looks for current pos >= EOF. This solves the bug where it loops indefinitely in close if written to /dev/null. 12 May, 1982 backspace on a lu at EOF now clears the stdio flags as well as the libI77 EOF flag. This fixes the problem of spurious EOF branches on terminal input. open now checks for a non-zero recl argument on sequential access files. It complains and ignores the recl spec. 10 January, 1983 Mag tape I/O routines added. See topen.3f. The reason is that Fortran-77 I/O requirements are very difficult (or impossible) to meet on mag tape. 15 April, 1983 new routine, ioinit, allows specifying "open at beginning" for files, carriage control on unit 6, and preset association of logical units with file pathnames from the environment. 28 April, 1983 The new kernel features of 4.2bsd have been incorporated. A number of obscure bugs fixed. Files are now opened at the BEGINNING!! 4.3 BSD, Mar-June, 1985: Appropriately named environment variables now override default file names and names in open statements. See "Intro. to I/O lib." for details. Unit numbers can vary from 0-99, number simultaneously open varies by system - I/O lib. doesn't check this. No longer explicitly initialize unit table to zero, it's global so C guarantees zeros; why waste space in the modules? Much of input scanning for formatted reads has been rewritten; illegal data will now be caught! On list directed reads, tabs are now fully equivalent to blanks; * followed by blanks now skips items in the list as the standard requires & counts work with complex data. Formats in format statements are compiled; those in character constants and variables in I/O statements are not. All errors call f77_abort() in libF77 for centralized error handling. Now attempt to get to next record if doing 'err=' branch on error. Standard does not require this, but it is nice not to leave the system hanging in mid record. Lot's of routines and variables made static; number of T,C, and D symbols in the library went from about 230 to 130. .c files reorganized so only get whats needed loaded; e.g. you no longer get formatted read routines loaded if you only do formatted writes. the library now checks for infinite loops in formats - printing multiple records after the list is exhausted. standard error is now buffered. error messages have been improved. July 12, 1985: Moved f77_abort() and patch it here from libF77/main.c so that C programs which call Fortran programs which do Fortran I/O will load properly. July 25, 1985: fixed auxilliary I/O to be closer to standard: close is no-op on non-existent unit or not connected unit; rewind & backspace are no-ops on non-connected units; endfile opens non-connected unit. inquire returns true when asked if units 0-MAXUNIT exist, false for other integers, it used to return false for legal but unconnected & error for illegal #s. Inquire now fills in all requested fields, even if file or unit doesn't exist or is not connected. inquire by unit now correctly returns unit number. Added Namelist I/O - mostly like IBM, but similar to VMS. Cosmetic change - 'sequential' and 'external' are now set only to YES and NO.