<< Click to Display Table of Contents >> Navigation: 3. Script Language > FEX. - Enumerations > Enumerations Commands (FEX) |
MiniRobotLanguage (MRL)
FEF. Enumeration Command
For each File (directory)
Intention
You want to make a list with all files in a folder? Print those hundreds of files? Or join them in one file? Or run a scan over all dirs in a drive or folder?
All these and many more jobs can be done using FEF.
Generally FEF. will enumerate and count Files and/or Directories from a given source path. After all this function leaves up to four information on the Stack (see below).
These are:
In detail the four values inform you about this:
1. Number of directories
2. Number of files and directories together
3. Bytes in all files, total
4. Number of files in all folders
Syntax
FEF.P1|P2|P3[|P4][|P5]
Parameter Explanation
P1 - Label where the for each will jump "for each element"
P2 - Temp. Variable, updated by FEX each round.
P3 - Root-Directory
P4 - (optional) Filepattern. If omitted, *.* is used.
P5 - (optional) Attribute, if omitted 69 is used. (Recurse, Files, Cooperative)
Attributes-Parameter
1 - Recurse into Subfolders
2 - Hidden files and folder, too.
4 - Files
8 - Dirs
16 - SizeDepth
32 - CountAll
64 - CoOperative Mode (Slower)
128 - System Files, too.
256 - Sort Downwards
Example
'**********************************************
' FEF-Sample
'**********************************************
' DBM.2
' Use an existing path here
: §§ROT=F:\00_Image
: §§PAT=*.*
FEF.:Tar|§§FIL|§§ROT|§§PAT|(1+4+8+64)
DMP.4
:over
MBX.Halt to read output
END.
:Tar
PRT.§§FIL
RET.
'**********************************************
Remarks
FEF. is a Member of the FEX-Family "For Each X". They are used for easy enumeration
Limitations:
The internal data storage can hold up to several hundred Megabytes of Directory data. Yet there is no warranty that there is not a file-system out there, that is too large in size to be fully enumerated.
See also:
• 3.1 Systemvariables especially: #fex#, #fxd# . etc.
• IEF. / NEF. - If - exist - File