I/O Statement

An I/O statement causes information to be exchanged between a program and a peripheral device, and allows the programmer to perform certain control functions.

<I/O statement>

──┬─<accept statement>────┬─────────────────────────────────────────┤
  ├─<close statement>─────┤
  ├─<display statement>───┤
  ├─<lock file statement>─┤
  ├─<open statement>──────┤
  ├─<read statement>──────┤
  ├─<rewind statement>────┤
  ├─<seek statement>──────┤
  ├─<space statement>─────┤
  └─<write statement>─────┘

ALGOL I/O is handled by a part of the operating system called the I/O subsystem. For more information on the I/O subsystem, refer to the I/O Subsystem Programming Guide.

The ACCEPT statement and DISPLAY statement are unique in that the file to or from which data is transferred need not be specified. For more information, refer to ACCEPT Statement and DISPLAY Statement.

The remaining I/O statements reference a file that must be declared by the program. For more information, refer to FILE Declaration.

Two distinct methods of I/O are available. The first and typical method is referred to as normal I/O; the second method is called direct I/O. The major differences between normal I/O and direct I/O have to do with buffering, the overlap of program execution, and the overlap of I/O operations. Their effect on a particular I/O statement is presented in the description of the statement.