|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Filesystem-Commands > FIL. - File-Commands > FIL.DIR-Commands > FIL. - File and Directory Commands |
SPR Script Language
FIL.GetDirArr
Searches for both Files and Directories across multiple folders using wildcards.
Intention
The FIL.MADIR command (Multi-Folder DIR All) is the most comprehensive search tool. It finds all directories matching a wildcard path, and then lists both the matching directories themselves AND all files within them that match the file part of the pattern. The combined results are stored in a single global array.
Illustration
🕵️ Full Investigation: This command acts like a detective told to investigate every office matching "Floor-*-Room-B". The detective returns a complete list of everything found: the office doors themselves (directories) and all the documents (files) inside those offices.
Syntax
FIL.GetDirArr|Array-No.|PathWithWildcards[|Options]
Parameter Explanation
P1 - Array-No. - (Numeric, Required)
The number (0-32) of the global array where the results will be stored.
P2 - PathWithWildcards - (String, Required)
The full path specification. Wildcards (*, ?) can be used in the directory parts and in the final filename part. Example: C:\Data\Archive*\Report*.pdf.
P3 - Options - (String, Optional)
A comma-separated string of keywords: INFO, SORTUP, SORTDOWN.
Examples
'***********************************
' FIL.GetDirArr - Sample 1: Find all user documents and their folders
'***********************************
' Find all "Documents" folders for all users, and all files inside them
FIL.GetDirArr|1|C:\Users\*\Documents\*.*
FIL.ArrayToVar|1|$$res
MBX.Found items:$$crlf$$$$res
ENR.
'
Remarks
- This command combines the functionality of FIL.MFDIR and FIL.MFDIRS.
- The final part of the path after the last `\` is treated as the file pattern. The preceding parts are the directory pattern.
See also: