FILEFIND.GET_RECURSE Function
Syntax
Arguments
- pathCharacter
The folder where the file search begins.
- patternCharacter
A pattern to select file names using wildcard characters like '*' and '? '.
- file_attributeNumeric
Optional. Default = FILE_FIND_NORMAL. The File Attribute parameter is a numeric value specifying the type of file to find. You can find files that have one or more of the following attributes: To find files that have combinations of attributes, add the attribute values together. For example, to find all hidden system files, use 6 (2 + 4) (or FILE_FIND_HIDDEN + FILE_FIND_SYSTEM, which evaluates to 6) as the attribute. Note : You can either specify the numeric value for the attribute, or you can use the system variable name. For example, FILE_FIND_NORMAL has a value of 0.
- File Attribute
- Description
- FILE_FIND_NORMAL
Normal
- FILE_FIND_READONLY
Read-only
- FILE_FIND_HIDDEN
Hidden
- FILE_FIND_SYSTEM
System
- FILE_FIND_LABEL
Label
- FILE_FIND_DIRECTORY
Directory
- FILE_FIND_ARCHIVE
Archive
- FILE_FIND_AND_FLAGS
Specifies that multiple flags should be ANDed together rather than ORed. By default flags are ORed.
- FILE_FIND_NOT_READONLY
Files that are NOT read-only
- FILE_FIND_NOT_DIRECTORY
Files that are NOT directory files
- FILE_FIND_NOT_ARCHIVE
Files that do not have their archive bit turned on.
- FILE_FIND_AND_NOT_FLAGS
Specifies that when multiple "NOT" flags are used that the flags should be ANDed together.
- filefindformatCharacter
Optional. Default = "pn". Specifies the type of file to retrieve. The format string can contain these characters: The format characters, D, H and S can be followed by optional true and false values enclosed in parentheses. E.g. the format string " D(directory - )(file - )N " would list entries in a folder. Each entry would be prefixed with either " directory - ", or " file - ", depending on its type. The C, R and T options can be followed by ( Format_String ). See TIME() function for Format_String options.
- Format Character
Represents
- P
Path
- N
Filename
- D
Directory - "d" if file is a directory, "-" if not.
- H
Hidden - "h" if file is hidden, "-" if not.
- S
System - "s" if file is a system file, "-" if not.
- T
Date and time file was last updated
- L
Size
- C
Creation date and time
- R
Last time read
- A
Archive bit
- X
DOS short name (8.3), if the file is a long file name
- SkipFoldersCharacter
For Internal Use Only.
Returns
- listCharacter
Returns a CR-LF delimited list of matching files.
Description
wrapper for FILEFIND.get() that recursively finds all files in pattern. Path is the starting path.
Discussion
The FILEFIND.GET_RECURSE() method is a high level wrapper for FILEFIND.GET() that recursively searches sub-directories to find all files that match a pattern.
The following example assembles a CR-LF delimited list of all HTML files in and below the doc_dir directory.
htm_files = FILEFIND.get_recurse(doc_dir, "*.htm", FILE_FIND_NORMAL+FILE_FIND_NOT_DIRECTORY, "P|N" + crlf())
See Also