read-registry(2)
[Home]
[Commands]
[Variables]
[Macro-Dev]
[Glossary]
NAME
SYNOPSIS
DESCRIPTION
read-registry loads a registry file
erf(8) into the internal registry memory, where the information may be queried via the registry macro commands. The arguments are defined as follows:-
root
The root node in the registry to into which the registry contents are attached. The root name is limited to 32 characters in length and is specified without a leading forward slash '/'. The node root is created at the root of the registry.
file
The name of the registry file
erf(8) to load. This may be an absolute, relative or $MEPATH specified file; typically it is located on $MEPATH.
mode
The mode is string specifying the registry node loading and saving modes, each mode is represented by a character. Lower case characters add a mode, upper case characters delete a mode. The modes are defined as follows:-
a - Autosave
Automatically saves the registry when it is deleted or unloaded from the registry. The user is not prompted for a save.
b - Backup
Automatically performs a backup of the registry file whenever a save operation is performed.
c - Create
If the registry file cannot be loaded then the root node is created and the invocation succeeds. If this mode is omitted then the call fails if the file cannot be found.
d - Discard
Marks the registry as discardable. This is typically used for registries that are not saved.
r - Reload
If the registry node already exists then it is deleted and reloaded, see also the merge flag (m). By default, when both the r and m flags are omitted and the registry node already exists the read operation is not performed and the existing node is used.
m - Merge
The registry file is merged with the contents of any existing registry node. (i.e. the existing registry tree nodes are not deleted if they already exist). See also the reload flag (r).
h - Hidden
The registry node is created in the Hidden state. (i.e. children will not be shown in
list-registry(2) output).
u - Updated
Marks the registry as modified. The modified bit is removed when the registry file is saved. If the modified bit is applied to a registry node the user will be prompted to save the registry when it is deleted (or it will be automatically saved when the Autosave mode is used).
EXAMPLE
The following example is a typical call made from a macro using a registry file where the user may edit the registry file. In this case this a reload of the registry is forced to ensure that the most up-to-date contents are retrieved. Note that the name of the registry file is actually retrieved from the history registry.
set-variable #l1 ® "/history" "address" $MENAME
!if &seq &set #l0 &find #l1 ".ab" "ERROR"
set-variable #l0 ® "/" "history" ""
set-variable #l0 &spr "%s%s.ab" &lef #l0 &rsin "/" #l0 #l1
!endif
read-registry "AddressBook" #l0 "rc"
BUGS
SEE ALSO
(c) Copyright JASSPA 1999
Last Modified: 1998/09/20
Generated On: 1999/12/01