Guardian Programmer's Guide

Table Of Contents
Manipulating File Names
Guardian Programmer’s Guide 421922-014
13 - 14
Truncating Default Parts of File Names
Truncating a Specified Subset of the Default Values
Alternatively, you can request that all default values to the left of a specified file-name
part be removed from the file name. Here, you need to use the level parameter to
specify the level of the first part of the name that will not be removed.
The following example selects the device (or process) level. Here, the node name will
be truncated from the file name if it matches the default node name. A device or
subvolume name, however, will not be truncated, even if it matches the default value:
LITERAL MAXLEN = 256;
LITERAL DEVICE^LEVEL = 0;
.
.
ERROR := FILENAME_UNRESOLVE_(FNAME:LENGTH,
SHORT^NAME:MAXLEN,
SHORT^NAME^LENGTH,
DEVICE^LEVEL);
IF ERROR <> 0 THEN ... !Error condition
The level parameter can have one of the following values:
Truncating Alternate Default Values
Normally, the FILENAME_UNRESOLVE_ procedure compares parts of the input file
string with the default values specified in the =_DEFAULTS DEFINE. However, you
can specify alternate default values using the defaults parameter.
The defaults parameter can name the subvolume (and optionally the volume and
network node) directly or provide the name of a defaults DEFINE that contains the
alternate names.
The following example specifies alternate default values directly:
LITERAL MAXLEN = 256;
LITERAL DEVICE^LEVEL = 0;
.
.
ALT^DEFAULTS ':=' "\SYSA.$ARCHIVE.AUGUST";
ERROR := FILENAME_UNRESOLVE_(FNAME:LENGTH,
SHORT^NAME:MAXLEN,
SHORT^NAME^LENGTH,
DEVICE^LEVEL,
-1 The first part always returned is the node name.
0 The first part always returned is the device name, process name, or logical
device name.
1 The first part always returned is the first qualifier of the file name. For
permanent disk files, this is the subvolume name.
2 This value refers to the second qualifier (or file ID for permanent disk files). No
default values are returned.