Guardian Programmer's Guide

Table Of Contents
Manipulating File Names
Guardian Programmer’s Guide 421922-014
13 - 25
Establishing the Start of a File-Name Search
The following example starts a search at the file following \SYSB.$ARCHIVE.S110189
for the file-name pattern \*.*.*.*. The search is limited to disk files:
LITERAL SKIP^IF^SAME = %B0000000000000001;
.
.
SEARCH^PATTERN ':=' "\*.*.*.*" -> @S^PTR;
PATTERN^LENGTH := @S^PTR '-' @SEARCH^PATTERN;
DEVICE^TYPE := 3;
OPTIONS := SKIP^IF^SAME;
START^NAME ':=' "\SYSB.$ARCHIVE.S110189" -> @S^PTR;
S^NAME^LENGTH := @S^PTR '-' @START^NAME;
ERROR := FILENAME_FINDSTART_(SEARCH^ID,
SEARCH^PATTERN:PATTERN^LENGTH,
!resolve^level!,
DEVICE^TYPE,
!device^subtype!,
OPTIONS,
START^NAME:S^NAME^LENGTH);
IF ERROR <> 0 THEN ... !Error condition
Note. For some file types, the search sequence might be alphabetic; for other file types, it
might not be. However, for a given file type, the search sequence is always the same for the
same release of the operating system.