next up previous contents
Next: Debugging Program Up: LNF Programming Environment Previous: CERNLIB

File Input/Output

The file attachment in UNIX is rarely made using logical units as on VMS. FORTRAN programs should take care to issue the proper OPEN statement with the name of the file coded in. Standard input and output (units 5 and 6) can be handled in the normal UNIX way:

myprog < mydata.inp > myresults.out

One may also give data records after the invocation of the executable:

We have used 'EoD' to stand for 'End of Data'. Any other string may be used as long as it is not part of the data records themselves.

When using other FORTRAN units numbers, the ln (link) command must be used. This is equivalent to ASSIGN in VMS . As an example:

ln -s mydata.out ftn10

Note that, unlike VAX , such file linking is permanent across sessions. It should be removed right after execution completion with the rm command:

rm ftn10

The original file will not be destroyed; only the link. An alternative approach is to use the OPEN statement, for example:



Massimo CARBONI
Wed Feb 14 19:03:34 WET 1996