| Prev | Next | Start of Chapter | Next Chapter | Contents | Glossary | Index | Comments | (9 out of 9)

Using a Module Map File to Load and Save a KB

When you work with KB files whose filenames are not the same as the names of the modules they contain, you can create a module map file to associate a module name with a particular KB file. If this file exists, G2 consults it to find the KB file that contains a particular module.

Locating the Module Map File

If you create a module map file, it must be named g2.mm. When a G2 process starts, it searches for the module map file as follows:

  1. If you include the -module-map option in the command line to start G2, G2 searches for the file at the fully qualified file pathname that is specified as an argument to the option.

  2. If you do not include the -module-map option in the command line to start G2, G2 checks whether a G2_MODULE_MAP environment variable (or VMS logical) is defined. If such an environment variable exists, G2 attempts to open g2.mm under the directory path assigned to that variable.

  3. If G2 locates no g2.mm file using Steps 1 and 2, G2 attempts to open g2.mm located in the directory that was current when you launched G2.


Tip: The -module-map command-line option is described in
module-map.

Adding Entries to the Module Map File

Use any text editor to create a module map file. It should contain only ASCII text.

Each line in the module map file associates the name of a module contained in a KB with either a fully qualified directory path or a fully qualified file path. Use one or more blank spaces to separate the module name from its associated directory path or file path.

When specifying a directory path, include a trailing directory delimiter character:

Use this delimiter: For this platform:
\
Windows
/
UNIX
]
VMS

For example, a module map file that describes two KBs that reside on a Windows platform could contain:

The first line specifies that G2 loads, merges, and saves the module named vehicle-root using the file \usr\jcm\kbs\modules\vh.kb. The second line specifies that G2 must load, merge, or save the module named vehicle-classes using a KB file of the same name (vehicle-classes.kb) under the directory \usr\dev\kbs\shared\.

A module map file that describes two KBs that reside on a VMS platform could contain:

The first line directs G2 to load, merge, or save the module named vehicle-root using the file MY$DISK:[my-g2-mods]vh.kb. The second line directs G2 to load, merge, or save the module named vehicle-classes using a KB file of the same name (vehicle-classes.kb) under the directory DEV$DISK:[shared-mods].

| Prev | Next | Start of Chapter | Next Chapter | Contents | Glossary | Index | Comments | (9 out of 9)

Copyright © 1997 Gensym Corporation, Inc.