Next: , Previous: Meta-Syntax, Up: Usage


2.3 Fortran I/O Units Usage by CONGEN

In order to keep CONGEN as machine independent as possible, all specification of files is done through Fortran unit numbers. Two unit numbers have special significance, 5 and 6. Unit 5 is the command file interpreted by CONGEN. Unit 6 is the output file for all printed messages. As commands are read from unit 5, they are echoed on unit 6. On Unix machines, unit 5 is usually the standard input, and unit 6 is the standard output. On VMS machines, unit 5 is assigned to the logical name, FOR005 which defaults to SYS$INPUT, and unit 6 is assigned to the logical name, FOR006 which defaults to SYS$OUTPUT. All other unit numbers have no predefined meaning. The OPEN command, see Open Command, can be used within CONGEN to open a file on a particular Fortran unit. The DCL command, ASSIGN, may be used on VMS systems to assign files to units. Unix systems can use whatever mechanism is provided with their Fortran run-time system to achieve this effect. E.g. on the Iris, one can make a symbolic link between fort.n and a file in order to associate unit n with the file.

On Unix systems, all file names in OPEN commands are translated to lower case. This permits CONGEN input files to be portable from VMS to Unix.

When CONGEN is about to read a file on a VAX/VMS machine, it opens the file as a shared, readonly file. This is done to allow users to share commonly useful files, such as topology files. One should be aware that this feature prevents a user from overwriting any file which he is reading. Any file which is written is not opened shared, so it cannot be used by any other process until CONGEN completes execution.

On most Unix machines, the normal I/O operation opens all files shared, so it is possible to read any file being read or written by CONGEN. When a file is opened for writing, any previous file is overwritten. If two CONGEN processes attempt to open the same file for writing, the result is unpredictable, and it is unlikely that the user will receive a warning message indicating he has made a mistake.