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:-
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.
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
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).
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" $user-name
!if &seq &set #l0 &find #l1 ".ab" "ERROR"
set-variable #l0 ® "/history" ""
set-variable #l0 &spr "%s%s.ab" &lef #l0 &rsin "/" #l0 #l1
read-registry "AddressBook" #l0 "rc"
Copyright (c) 1998-2006 JASSPA
Last Modified: 2005/01/23
Generated On: 2006/10/07