Guardian Programmer's Guide

Table Of Contents
Manipulating File Names
Guardian Programmer’s Guide 421922-014
13 - 6
Scanning a String for a Valid File Name
Scanning File-Name Patterns
To accept a file-name pattern in the input string of the FILENAME_SCAN_ procedure,
you need to set the accept-pattern flag (bit 15) in the options parameter to 1.
The options parameter goes at the end of the parameter list:
LITERAL ACCEPT^PATTERNS = %B0000000000000001;
.
.
OPTIONS := ACCEPT^PATTERNS;
ERROR := FILENAME_SCAN_(STRING^BUFFER:STRING^LENGTH,
COUNT,KIND,
LEVEL,
OPTIONS);
IF ERROR <> 0 THEN ... ! Error condition
Scanning Subvolume Names
To accept subvolume names in the input string of the FILENAME_SCAN_ procedure,
you need to set the accept-subvol flag (bit 14) in the options parameter to 1:
LITERAL ACCEPT^SUBVOLS = %B0000000000000010;
.
.
OPTIONS := ACCEPT^SUBVOLS;
ERROR := FILENAME_SCAN_(STRING^BUFFER:STRING^LENGTH,
COUNT,
KIND,
LEVEL,
OPTIONS);
IF ERROR <> 0 THEN ... ! Error condition
Scanning File Names: Some Examples
The following examples list valid input strings, assuming that your program chooses to
accept file name patterns and subvolumes as valid input strings to the
FILENAME_SCAN_ procedure:
String Count Level Comments
\SYSA 6 -1 Valid form of node name
\*.$*.* 6 1 Subvolume pattern
$VOLUME1.ACCOUNTS.OVERDUE,NAME 25 2 Last part of string
ign
ored
$SERV 5 0 Process file name