Guardian Application Conversion Guide

Managing Your Disk Files
Converting Other Parts of an Application
8–4 096047 Tandem Computers Incorporated
Extracting Parts of a File Name
Your existing program might extract parts from an internal-format file name. For
example, you might extract the volume name from a file name.
Convert your program to call the FILENAME_DECOMPOSE_ procedure, which
returns one or more parts of a file-name string. You specify the parts that are to be
returned with the
level
input parameter. In this example,
FILENAME_DECOMPOSE_ returns the volume name and its length. The
level
parameter is set to ZSYS^VAL^FNAME^LEVEL^DEVICE to specify the volume:
level := ZSYS^VAL^FNAME^LEVEL^DEVICE; ! Value = 0.
error := FILENAME_DECOMPOSE_(file^name:file^name^length,
volume^name:max^length,
volume^name^length,
level);
Modifying Parts of a File Name
Your existing program might modify parts of an internal-format file name. For
example, you might change the subvolume name to a new subvolume name without
changing the other parts of the name.
Convert your program to call the FILENAME_EDIT_ procedure, which allows you to
modify one or more parts of a file-name string. You specify the parts that are to be
modified with the
level
input parameter.
In this example, FILENAME_EDIT_ changes the subvolume name to
subvol^name
and leaves the remaining parts of the file name intact. The
level
parameter is set to
ZSYS^VAL^FNAME^LEVEL^SUBVOL to specify the subvolume:
level := ZSYS^VAL^FNAME^LEVEL^SUBVOL; ! Value = 1.
error := FILENAME_EDIT_ (file^name:max^length,
file^name^length,
subvol^name:subvol^name^length,
level);
Comparing Two File Names
Your existing program might call the FNAMECOMPARE procedure to compare two
file names or device names:
error := FNAMECOMPARE (filename1, filename2);
Convert your program to call the FILENAME_COMPARE_ procedure, which
compares two file-name strings to determine whether they refer to the same file or
device.
FILENAME_COMPARE_ requires a variable-length string for each of the input file
names rather than the 12-word internal-format file names. If the file names are
incomplete, FILENAME_COMPARE_ uses the current settings, including the node
name, from the =_DEFAULTS DEFINE for the unspecified parts.