Guardian Programmer's Guide

Table Of Contents
Manipulating File Names
Guardian Programmer’s Guide 421922-014
13 - 24
Establishing the Start of a File-Name Search
Setting Up a Search for Process Qualifier Names
For the qualifier names of a process to be seen by the procedures that search for file
names, the process must indicate its ability to perform qualifier name searches. It
does so by issuing a PROCESS_SETINFO_ procedure call as follows:
LITERAL QUALIFIER^INFO = 49;
.
.
ATTVAL := 1;
ERROR := PROCESS_SETINFO_(!process^handle!,
!specifier!,
QUALIFIER^INFO,ATTVAL,1);
A process which does this must be prepared to service -107 system messages arriving
on $RECEIVE.
For processes that make their qualifiers known in this way, you can bypass process
qualifiers when searching for names. You do so by setting the no-subprocesses
flag (bit 11) in the options parameter to 1:
LITERAL NO^SUBPROCESSES = %B0000000000010000;
.
.
SEARCH^PATTERN ':=' "$L*.#*" -> @S^PTR;
PATTERN^LENGTH := @S^PTR '-' @SEARCH^PATTERN;
RESOLVE^LEVEL := 0;
OPTIONS := NO^SUBPROCESSES;
ERROR := FILENAME_FINDSTART_(SEARCH^ID,
SEARCH^PATTERN:PATTERN^LENGTH,
RESOLVE^LEVEL,
!device^type!,
!device^subtype!,
OPTIONS);
IF ERROR <> 0 THEN ... !Error condition
Specifying a Name to Start Searching From
You can select a name at which the search will start. This feature might be useful, for
example, when restarting a search that has been interrupted.
You specify the name in the startname parameter of the FILENAME_FINDSTART_
procedure. This name should be somewhere in the sequence of names described by
the file-name pattern.
Normally, the search starts at the named file or at the next name in the sequence if the
named file does not exist. However, you can force the search to start at the name
following the named file, even if the name does exist, by setting the skip-if-same
flag (bit 15) in the options parameter to 1.