Guardian Programmer's Guide

Table Of Contents
Manipulating File Names
Guardian Programmer’s Guide 421922-014
13 - 4
Scanning, Resolving, and Unresolving File Names
The following examples show the use of wild-card characters:
Scanning, Resolving, and Unresolving File
Names
This subsection discusses the following operations on file names:
How to use the FILENAME_SCAN_ procedure to test that a string contains a valid
file name or file-name pattern.
How to use the FILENAME_RESOLVE_ procedure to expand a file name or
file-name pattern into a fully qualified file name using default values for the node,
volume, and subvolume names.
How to use the FILENAME_UNRESOLVE_ procedure to remove any part of the
file name or file-name pattern that is currently part of the default values.
How to use the FILENAME_DECOMPOSE_ procedure to extract elements of a file
name or file-name pattern; for example, to extract the volume name from a file
name.
Scanning a String for a Valid File Name
To check that a given character string contains a valid entity name (or name pattern),
you use the FILENAME_SCAN_ procedure. You typically do this before using a file
name in any other way. FILENAME_SCAN_ is the only procedure for manipulating file
names that completely checks the validity of an input file name.
Scanning file names checks that the sizes of file-name parts or file-name-pattern parts
are valid and that the tested substring is immediately followed by a character that is not
allowed in a file name or file-name pattern. Note that only the syntactic correctness of
the name is checked; no attempt is made to check for the existence of the named
entity.
*Z* Matches all file names containing the letter Z in the current subvolume
$S.* Matches all locations of the spooler on the current system
*.*.* Matches all permanent files on the current system, as well as processes
with two qualifiers
\*.$DATA Matches $DATA on all systems
\* Matches all systems
Z? Matches all two-character file names in the current volume that start
with the letter Z