search files, search files recursive
Searches the disk for a particular files and/or directories and returns the full paths.
Note:Files searched are not guaranteed to be in any deterministic order, e.g. alphabetic order. Ordering behaviors differ among operating systems.
The resulting file names contain the path name as specified. Example. If ".\sudir" is specified, then this (relative) path name will be added to all file and directory names returned.
Files listed in the current directory contain no path names in front.
Indirect parameter passing is disabled
0-4
No. | Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Opt. 1 input |
string | drive or path name Specify a disk drive (e.g. C:\) or a path name (/usr/local, or \\server_name\path_name\...).
If no additional parameters are provided, then the path name may also contain a file name (to list 1 file) or matching pattern to list specific files. | ||||||||
Opt. 2 input |
string | pattern name Specify a disk drive (e.g. C:\) or a path name (/usr/local, or \\server_name\path_name\...).
If no additional parameters are provided, then the path name may also contain a file name (to list 1 file) or matching pattern to list specific files. | ||||||||
Opt. 3 input |
numeral | Match count limitation <0 Search for all matches and return set containing all names. A set is also used if only one item has been found. | ||||||||
Opt. 4 input |
string | search option One of the following:
Default value: files and directories |
Type | Description |
---|---|
string set |
Identified names All file and directory names found as specified. |
echo("All files in a directory : ", search files( "C:\Program Files\B4P\" ), new line );
echo("All files : ", search files( ".\", "*.b4p" ) );
echo("1st file only (as string) : ", search files( ".\", "*.b4p", 0 ) );
echo("1st file only (in set): ", search files( ".\", "*.b4p", 1 ) );
echo("1st file only (as string) : ", search files( "..\", "*", 0 ), new line ); // One directory up
echo("All subdirectories : ", search files( "C:\Program Files\B4P", "*", -1, directories ) );
echo("All .b4p/.txt recursively : ",
search files recursive( "C:\Program Files\B4P", "*.txt,*.b4p", -1, files ) );
All files in a directory : {'C:\Program Files\B4P\B4P Reference Manual.b4p','C:\Program Files\B4P\B4P Style Themes.xlsx','C:\Program Files\B4P\B4P.exe','C:\Program Files\B4P\b4picon.ico','C:\Program Files\B4P\Install.txt','C:\Program Files\B4P\List of Locales.csv','C:\Program Files\B4P\Setup.exe','C:\Program Files\B4P\vcruntime140.dll','C:\Program Files\B4P\vcruntime140_1.dll'}
All files : {'Build_Docu.b4p','Example_Program.b4p','interactive.b4p','Make_Index.b4p','Start B4P here.b4p','table_lookup_smart_new.b4p'}
1st file only (as string) : Build_Docu.b4p
1st file only (in set): {'Build_Docu.b4p'}
1st file only (as string) : ..\Analzyer.zip
All subdirectories : {'C:\Program Files\B4P\lib','C:\Program Files\B4P\weblib'}
All .b4p/.txt recursively : {'C:\Program Files\B4P\B4P Reference Manual.b4p','C:\Program Files\B4P\Install.txt','C:\Program Files\B4P\lib\B4P Init.b4p','C:\Program Files\B4P\lib\Console Library.b4p','C:\Program Files\B4P\lib\help\Help Access Local Docs.txt','C:\Program Files\B4P\lib\help\Help Access Online Docs.txt','C:\Program Files\B4P\lib\help\Help Basic Commands.txt','C:\Program Files\B4P\lib\help\Help Interactive.txt','C:\Program Files\B4P\lib\help\Help Start.txt','C:\Program Files\B4P\lib\help\Help System Commands.txt','C:\Program Files\B4P\lib\help\Help Tables.txt','C:\Program Files\B4P\lib\help\Help Variables.txt','C:\Program Files\B4P\lib\help\Shortcuts.txt','C:\Program Files\B4P\lib\Interactive Help.txt','C:\Program Files\B4P\lib\Office Library.b4p','C:\Program Files\B4P\lib\Short Commands Library.b4p','C:\Program Files\B4P\lib\Style Library.b4p','C:\Program Files\B4P\lib\Support Library.b4p','C:\Program Files\B4P\lib\Utility Library.b4p','C:\Program Files\B4P\lib\Zip Library.b4p'}