Guardian Application Conversion Guide
Managing Your Disk Files
Converting Other Parts of an Application
096047 Tandem Computers Incorporated 8–3
Expanding Partially Qualified File Names
Your existing program might call the FNAMEEXPAND or FNAME32EXPAND
procedure to expand a partially qualified external file name to a 12-word internal-
format file name:
length := FNAMEEXPAND (external^filename,
internal^filename,
default^vol^subvol);
Convert your program to call the FILENAME_SCAN_ and FILENAME_RESOLVE_
procedures. FILENAME_SCAN_ checks the syntax of an input file-name string and
returns the length in bytes of the file name (provided a valid name is found).
FILENAME_RESOLVE_ then converts a partially qualified file name to a fully
qualified file name.
Note If you are passing a file name to a D-series procedure, you do not have to call FILENAME_RESOLVE_
after you call FILENAME_SCAN_. A D-series procedure automatically expands a partially qualified file
name to a fully qualified file name using the current settings, including the node name, from your
=_DEFAULTS DEFINE VOLUME attribute.
In the example below, FILENAME_SCAN_ scans the
name
parameter for a valid file
name and, if a valid name is found, returns the length of the name in the
name^byte^count
parameter.
FILENAME_RESOLVE_ then expands the file name into the
file^name
parameter
and sets the
file^name^length
parameter to the length in bytes of the fully
qualified name:
! Check for a valid file name.
error := FILENAME_SCAN_(name:name^length,
name^byte^count);
IF NOT error THEN
BEGIN
! Expand the file name.
error := FILENAME_RESOLVE_(name:name^byte^count,
file^name:max^length,
file^name^length);
END;