Guardian Programmer's Guide

Table Of Contents
Manipulating File Names
Guardian Programmer’s Guide 421922-014
13 - 33
Manipulating File Names: An Example
!Check for an incomplete match between the volume level
!prefix and the complete file-name pattern:
STATUS := FILENAME_MATCH_(PREFIX:PREFIX^LENGTH,
PATTERN:PATTERN^LENGTH);
CASE STATUS OF
BEGIN
!Incomplete match:
1 -> BEGIN
!Check for a complete match
STATUS := FILENAME_MATCH_(FULLNAME:FULL^LENGTH,
PATTERN:PATTERN^LENGTH);
CASE STATUS OF
BEGIN
2 -> !Complete match
0 -> !No match
OTHERWISE -> !Error condition
END;
END;
!No match:
0 ->
!Error:
OTHERWISE ->
END;
Matching File Names: Some Examples
The following examples show the result of comparing a name with a name pattern
using the FILENAME_MATCH_ procedure:
Manipulating File Names: An Example
This subsection presents a sample program that lists file names, resolved to their fully
qualified form. The program should be run from the TACL prompt. It expects one
parameter that specifies the names to be listed.
The user specifies one of the following in the command-line parameter:
A single file name. This name can be partially or fully qualified. In either case, the
program displays the fully qualified name.
Name Pattern Result
$PROC1.#Q1 $P*1.* Complete match
$PROC1 $P*1.* Incomplete match
\SYSA.$PROC1.#Q1 $P*1.* No match