Guardian Programmer's Guide

Table Of Contents
Manipulating File Names
Guardian Programmer’s Guide 421922-014
13 - 7
Resolving Names
Resolving Names
To resolve a name into its fully qualified form, you use the FILENAME_RESOLVE_
procedure. This procedure takes a string value containing a partially resolved name as
its input, uses the default values to replace any missing parts, and then returns the fully
qualified name.
In addition to the default action of resolving a file name, the FILENAME_RESOLVE_
procedure is able to resolve subvolume names; process and expand DEFINEs;
override the current network node, volume, and subvolume default values; use a
search DEFINE to find a name to resolve; or override the input file-name string with a
DEFINE. The following paragraphs explain how.
Resolving File Names
To resolve a partially qualified file name into its fully qualified form, you use the
FILENAME_RESOLVE_ procedure without any options. The default action of this
procedure is to expand any partially qualified file name provided in its input string.
Subvolume names are not resolved without using special options. Moreover, no
special processing of DEFINE names is done without the use of special options;
DEFINE names are returned without change.
The following example shows typical use of the FILENAME_RESOLVE_ procedure in
qualifying a file name checked by the FILENAME_SCAN_ procedure:
LITERAL MAXLEN = 256;
.
.
ERROR := FILENAME_SCAN_(STRING^BUFFER:STRING^LENGTH,
COUNT,KIND,LEVEL);
IF ERROR <> 0 THEN ... ! Error condition
ELSE
BEGIN
ERROR := FILENAME_RESOLVE_(STRING^BUFFER:COUNT,
FULLNAME:MAXLEN,
FULL^LENGTH);
IF ERROR <> 0 THEN ... ! Error condition
END;
Here, the FILENAME_RESOLVE_ procedure takes its string input in
STRING^BUFFER and returns the fully qualified name in FULLNAME. The length of
the fully qualified name is returned in FULL^LENGTH.
Caution. Passing an invalid name or file-name pattern to the FILENAME_RESOLVE_
procedure can result in a signal, trap, or data corruption. To verify that a name is valid, use the
FILENAME_SCAN_ procedure.