Guardian Programmer's Guide

Table Of Contents
Using the File System
Guardian Programmer’s Guide 421922-014
2 - 10
Using CLASS MAP DEFINEs
Using CLASS MAP DEFINEs
A DEFINE is a collection of attributes to which a common name has been assigned.
These attributes can be passed to a process simply by referring to the DEFINE name
from within the process. The =_DEFAULTS DEFINE is an example of such a DEFINE;
this DEFINE passes the default node name, volume, and subvolume to a process.
The DEFINE mechanism can be used for passing file names to processes; this kind of
DEFINE is called a CLASS MAP DEFINE. The following example creates a CLASS
MAP DEFINE called =MYFILE and gives it a FILE attribute equal to
\SWITCH.$DATA.MESSAGES.ARCHIVE:
1> SET DEFINE CLASS MAP, FILE \SWITCH.$DATA.MESSAGES.ARCHIVE
2> ADD DEFINE =MYFILE
Whenever your process accesses the DEFINE =MYFILE, it gets the name of the file
specified in the DEFINE. For example, when your process opens =MYFILE, the file
that actually gets opened is \SWITCH.$DATA.MESSAGES.ARCHIVE.
See Section 7, Using DEFINEs, for a complete discussion on how to use DEFINEs in
your application programs.
Using the Startup Sequence
The startup sequence is a sequence of messages that are passed from the parent
process to the new process when the process is created. The exchange of messages
has to be agreed upon by both processes but typically involves passing a form of the
IN and OUT file names in the Startup message, and sometimes other file names in
Assign messages.
See Section 8, Communicating With a TACL Process, for information on how to access
this information for processes that are started by the TACL process. For processes
that are started from an application, see Section 16, Creating and Managing
Processes.
Creating and Accessing Files
The rest of this section describes how to use Guardian procedures to perform common
operations on files, such as creating, opening and closing, and reading and writing, as
well as gathering information about files and handling file-system errors.
Creating Files
The technique for creating files depends on the type of file you are creating. You can
create files interactively through the TACL command interpreter or certain utilities or
programmatically by calling Guardian procedures. This guide is concerned with
manipulating files programmatically. For details of the relevant command-interpreter
commands, read the Guardian Users Guide.