Chapter 9. Input/Output Processing

Revision History
Revision V6.3-001 20 March 2017
Revision V6.2-001 27 February 2015
  • In “Socket Device Examples”, specified that the ZSHOW "D" command reports available information on both the local and remote sides of a TCP socket and enhanced the downloadable example to include more debugging information.

  • Updated “WRITE Command” for WRITE /PASS, WRITE /ACCEPT, and WRITE /TLS.

  • In “OPEN Deviceparameters” and “USE Deviceparameters”, added “IKEY”,“KEY”, “OKEY” keywords.

  • In “REWIND”, specified that when $PRINCIPAL identifies a device that supports REWIND, the REWIND or INREWIND device parameters perform a REWIND of the input and OUTREWIND performs a REWIND of the output.

  • In “DESTROY”, added the behavior of a sequential disk device CLOSEd with the NODESTROY.

  • In “READ/WRITE Operations”, specified that WRITE works at the current file position, whether attained with APPEND, REWIND or SEEK.

  • In “TRUNCATE”, specified that the TRUNCATE device parameter on a USE $PRINCIPAL command works on a stdout device when the device supports the action.

  • In “DESTROY”, moved the reference to the behavior of sequential disk devices CLOSEd with NODESTROY to “Open”.

Revision V6.1-000 28 August 2014
Revision V6.0-003 24 February 2014
Revision V6.0-001 21 March 2013

In “EXCEPTION”, added a note about the handling of non-fatal errors.

Revision V6.0-000 19 November 2012
Revision V5.5-000/1 05 October 2012
Revision V5.5-000 20 May 2012 In Section : “FIFO Characteristics”, corrected the description of FIFO behavior with WRITEs.
Revision V5.4-002B 26 December 2011 Conversion to documentation revision history reflecting GT.M releases with revision history for each chapter.

Table of Contents

I/O Intrinsic Special Variables
Device Name Variables
Cursor Position Variables
Status Variables
I/O Devices
I/O Device Recognition
Device Specification Defaults
How I/O Device parameters Work
Abbreviating Deviceparameters
Document Conventions
Device-Independent Programming
Using Terminals
Setting Terminal Characteristics
Logical Records for Terminals
READ * Command for Terminals
READ X#maxlen Command for Terminals
Terminal Deviceparameter Summary
Terminal Examples
Using Sequential Files
Setting Sequential File Characteristics
Sequential File Pointers
Line Terminators
READ/WRITE Operations
Writing Binary Files
Sequential File Deviceparameter Summary
Sequential File Examples
FIFO Characteristics
Considerations in Implementing FIFOs
Error Handling for FIFOs
GT.M Recognition of FIFOs
FIFO Device Examples
FIFO Deviceparameter Summary
Using Null Devices
Null Deviceparameter Summary
Null Device Examples
Using PIPE Devices
Modes of PIPE Operation
PIPE Characteristics
PIPE Device Examples
PIPE Deviceparameter Summary
Using Socket Devices
Message Management
Socket Read Operation
Socket Read Termination Conditions
Message Delimiters
Read Command
WRITE Command
Socket Device Operation
Socket Deviceparameter Summary
Socket Device Examples
I/O Commands
Open
Use
READ
Write
WRITE *
Close
Deviceparameter Summary Table

This chapter describes the following topics which relate to input and output processing:

OPEN, USE, and CLOSE commands accept deviceparameters, which are keywords that permit a GT.M program to control the device state. Some deviceparameters require arguments. The current ANSI standard for GT.M does not define the deviceparameters for all devices. This chapter includes descriptions of the GT.M deviceparameters in the sections describing each command.

[Note] Note

The term "device" can refer to an entity manipulated by application code using Open, Use, Close, Read and Write commands as well as a device from the perspective of the operating system. We endeavor herein to always make it clear from the context which meaning is intended.