HPlogo Asynchronous Serial Communications Programmer's Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 2 Controlling Asynchronous Devices Programmatically

File System Overview

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

File System Overview All input/output operations on MPE/iX systems are done through the mechanism of files. All files are considered the same (part of the system file domain), and handled in the same way. Because of this, the way that input or output data is accessed and treated is the same no matter what medium it resides on. This feature is called device independence, and allows for a great deal of flexibility in handling data.

There are two basic types of files:

  • Disk files, which are files residing on disk, immediately accessible to the system and potentially sharable by several sessions/jobs at the same time.

  • Devicefiles, which are files currently being input to or from any peripheral device except a disk. A devicefile is accessed exclusively by the session or job that acquires it and is owned by that session/job until that session/job releases it or terminates.

File Equations

Because of device independence, files are not restricted to the same type of device every time a program is run. File equations can be used to specify the device you want your program to access at run time. File equations associate the formal file designator of a file to a specific device, or type of device. The formal file designator is the name by which your program recognizes the file. It is the file name coded in your program along with the program's specifications for the file.

As an example of changing device assignment at run time, consider a program designed to write information contained in a file with the formal file designator of outfile to a line printer. You may want to direct the output to a terminal on a one time only basis. You could do this by using a file equation to direct the file to the terminal's ldev. For a terminal with an ldev of 124 the file equation would be:

:FILE OUTFILE;DEV=124

where FILE is the command, OUTFILE is the formal file designator, and DEV=124 specifies the device configured as ldev 124.

File equations must be issued before a file is accessed, and they take effect when the file is accessed. They remain in effect until the job or session ends unless they are canceled with a :RESET command or overridden by another command for the same file.

The :FILE command can be used to modify many programmatic or system default file specifications. There are, of course, certain restrictions on what can be modified by a file equation. The device must be suited to the characteristics being specified. Data directed to terminals or printers, for example, must be in ASCII format, and have a blocking factor of 1. These are device-dependent characteristics, and if you try to specify something different it will be overridden. See the Accessing Files manual for a summary of device-dependent characteristics.

File System Hierarchy

There is a basic hierarchy to the way the File System overrides file specifications. Device dependence is at the top of the hierarchy and will override any attempts to modify file characteristics in a manner inappropriate to the device being used. Figure 2-1 “File System Hierarchy” shows which methods of specifying file characteristics take precedence in the File System hierarchy.

Figure 2-1 File System Hierarchy

[File System Hierarchy]

The FFILEINFO intrinsic can be used to determine what specifications are currently in place for a given file. FFILEINFO is described in more detail in Chapter 8 “Intrinsics Reference” of this manual.

See the Accessing Files manual for detailed information on the MPE/iX File System.