Declaring, opening and closing keyed filesΒΆ

Each keyed file required by a screen form program must be declared within the program by the command ![o]file.

The !ofile command declares a file which is open when the program commences.

The !file command declares a file which is closed when the program commences.

These declarations are instructions to the compiler. The compiler requires the data dictionary file for each keyed file that is declared. It does not require the index and data files, which are only necessary at run time.

There is no specific limit to the number of Sculptor keyed files that may be open at any one time, available memory and operating system restrictions being the only limiting factors. The exception to this is that clients who connect to kfserver using earlier versions of Sculptor than 4.2 are restricted to 400 open files.

If the maximum number of files permitted by the operating system is exceeded, then the program aborts. Note that each secondary index for an open file counts as an extra file.

At run time, files declared as closed to the compiler are not opened on startup. The openfile, open, closefile and close commands are used to open and close Sculptor keyed files during program execution. This permits the location of the files to be decided at run time; they may be on a different file system or even a different server.

Sculptor attempts to open a file automatically if it is required by a file access or update command, and is found to be closed. However, it is recommended that programs do not depend on this behaviour, and open files explicitly.


RELATED TOPICS

Keyed files