Guardian Programmer's Guide

Table Of Contents
Communicating With Devices
Guardian Programmer’s Guide 421922-014
9 - 3
Accessing Devices
So how do you know the name of the device you want your program to communicate
with? It depends on the device in question. If you simply want to communicate with the
home terminal of the process, you can get the home terminal name using the
PROCESS_GETINFO_ procedure:
CALL PROCESS_GETINFO_(!process^handle!,
!file^name:maxlen!,
!file^name^len!,
!priority!,
!moms^processhandle!,
TERMINAL^NAME:MAXLEN,
LENGTH);
To communicate with the IN or OUT file specified in the Startup message, get the file
name from the Startup message using the INITIALIZER procedure as described in
Section 8, Communicating With a TACL Process.
If you need to communicate with a specific terminal, you can find the name of the
terminal by issuing the WHO command on the terminal in question:
9> WHO
Home terminal: \SYS.$MASTER
.
.
For terminals you cannot physically access, or for printers, magnetic tape units, or any
other device, you should ask your system administrator for information about the
device names or logical device numbers configured on your system.
Accessing Devices
Device access is the same as for any file. However, you cannot create device files in
an application program. The files are created during system configuration along with
the device names and logical device numbers.
The basic actions of opening, closing, reading from, and writing to devices have
al
ready been discussed in Section
2, Using the File System. In addition to these basic
operations, however, your program can also retrieve information about a specific
device; see Getting Device Information later in this section.