Guardian Procedure Calls Reference Manual (G06.25+)

Guardian Procedure Calls (F)
Guardian Procedure Calls Reference Manual522629-013
5-202
FILENAME_SCAN_ Procedure
entity-level output
INT .EXT:ref:1
identifies the class of entity represented by the supplied name based on its syntax.
This value corresponds to the “level” of the rightmost name section that appears.
Possible values are:
-1 Node name.
0 Name of device or process without qualifiers.
> 0 Name of device or process with
entity-level qualifiers.
Note that a disk file name always has an
entity-level greater than 0 (1 if it is a
temporary file; 2 if it is a permanent file). The value returned is not affected by
whether name sections to the left are implied (that is, defaulted).
A DEFINE name always yields a value of 0.
options input
INT:value
specifies options. The bits, when equal to 1, have the following meanings:
<0:13> Reserved (specify 0).
<14> Specifies that a subvolume name be accepted as valid input.
<15> Specifies that a file-name pattern be accepted as valid input.
The default value is 0.
Considerations
The syntax checking performed by FILENAME_SCAN_ includes checks that the
lengths of individual name parts are acceptable. (For example, it checks that a
subvolume name is no more than 8 characters long.) Unless a name occupies the
entire input string, FILENAME_SCAN_ also requires that the character following
the name must not belong to the set of characters that can appear in a file name or
file-name pattern.
FILENAME_SCAN_ checks only that some left-hand part of the input string is a
valid name; it does not require that the name occupy the entire string. If you need
such a check, you can compare the length of
string to the returned count.
Example
The following example checks that name is a valid file name with a length of namelen
bytes.
error := FILENAME_SCAN_ ( name:namelen, count );
IF error <> 0 OR count <> namelen THEN ! if bad name then
CALL BAD^FILENAME^FOUND; ! call user procedure