HP Pascal/iX Programmer's Guide (31502-90023)
3-: 3
Figure 3-2. File Relationships
Physical Files
A
physical file
is a program-independent entity that the operating system
controls. It can be a file on a disk or other medium, or an interactive
file created at a terminal (refer to your operating system manual for
information on creating and controlling physical files).
Your program can manipulate a physical file if the physical file is
associated with one of the program's logical files. In this case, the
physical file assumes the characteristics of the logical file.
Logical Files
A
logical file
is a data structure that a program declares and controls.
It is a sequence of components of the same type.
The declaration of a logical file determines the type of its components
but not their number. A logical file that is declared FILE OF
x
has
components of type
x
. File operations can change the number of file
components.
A logical file does not exist outside the main program or routine that
declares it. If it is associated with a physical file, however, anything
that happens to the logical file within the program also happens to the
physical file. This is how a program can manipulate its external
environment.
NOTE In subsequent sections of this chapter, the term
file
refers to a
logical file unless otherwise noted.