count files, count files recursiveSearches the disk for a particular files and/or directories and counts them
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 |
|---|---|
| numeral | Number of files and/or directories found |
echo("All files in a directory : ", count files( "C:\Program Files\B4P\" ), new line );
echo("All files : ", count files( ".\", "*.b4p" ) );
echo("1st file only : ", count files( ".\", "*.b4p", 0 ) );
echo("1st file only (same) : ", count files( ".\", "*.b4p", 1 ) );
echo("3 files only : ", count files( ".\", "*.b4p", 3 ), new line );
echo("All subdirectories : ", count files( "C:\Program Files\B4P", "*", -1, directories ) );
echo("All .b4p/.txt recursively : ",
count files recursive( "C:\Program Files\B4P", "*.txt,*.b4p", -1, files ) );All files in a directory : 9
All files : 6
1st file only : 1
1st file only (same) : 1
3 files only : 3
All subdirectories : 2
All .b4p/.txt recursively : 20