Initializing help system before first use

findfiles

Purpose
Search for files according to file name patterns.
Synopsis
procedure findfiles(opt:integer,lsf:list of text, dir:string|text,filters:string|text)
procedure findfiles(opt:integer,lsf:list of text,filters:string|text)
procedure findfiles(lsf:list of text,filters:string|text)
procedure findfiles(lsf:list of text)
Arguments
opt 
Options (several options can be combined):
SYS_RECURS 
Recursive search in subdirectories
SYS_NODIR 
Do not report directories (only files)
SYS_DIRONLY 
Report only directories
SYS_REVORD 
Reverse sort order
SYS_NOSORT 
Do not sort resulting list
lsf 
Resulting list of file names
dir 
Base directory for the search (default: current directory)
filters 
File name filters (default: all files reported)
Example
The following prints the list of files with extension .mos and .bim of the current directory:
findfiles(lsf,"*.mos|*.bim")
writeln(lsf)
Further information
1. The filters argument consists in a list of patterns separated by the symbol ";": for each of these patterns the function executes a search from the specified dir directory. A pattern is composed of a path (using the usual operating system conventions) which last component may include wildcard characters "*" (any text of any length), "?" (any single character) and "|" (logical "or"). For instance "bin/*.exe;models/*.mos|*.dat" will select all files with extension ".exe" in the "bin" directory as well as files with extension ".mos" and ".dat" in the "models" directory.
2. File name matching is achieved using function pathmatch and differences may be observed depending on the operating system ( e.g. file names are case sensitive under Posix systems but not under Windows).
3. Unless option SYS_NOSORT is used, the resulting list is sorted and duplicate entries are removed. Note also that the provided list lsf is not reset: the result of the search is appended to this list.
Related topics
Module

© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.