next up [*] [*]
Next: 4. Memory Manager Module Up: I. Utility Modules Previous: 2. Errors Module Notes

3. Input / Output Module

The aim of the input / output module is to contain all calls relating to opening and closing files in a separate portion of the source code. There is always an element of non-portability in the opening or closing of files. If all routines related to these operations are contained in a module it means that it limits the places PHYSICA has to be changed when moving from one platform to another. A consequence of this is that PHYSICA uses its own functions for opening and closing files. These functions called file_open and file_close are contained in the iounit.

The routine file_open is passed integer flags to specify the format, status and access strings to be used in the opening of the named file. The unit number attached to the open file is a return value from the routine. Using this techniques removes the chances of reusing unit numbers. PHYSICA makes use of unit numbers 1 to 20. If it is necessary to open files without using these utility routines then unit numbers outside this range should be used. Details of these utility routines can be found in the PHYSICA developer's guide.

Functions are also provided which return the unit numbers to be used for both keyboard input, standard input, and for writing to the screen, standard output.


next up [*] [*]
Next: 4. Memory Manager Module Up: I. Utility Modules Previous: 2. Errors Module Notes

2002-12-09