Directory Loop
The Directory loop task allows you to monitor a directory based on filename, file size or file date. For every file that satisfies the criteria, the Directory loop task will run another task. This other task can be a processing task that works on the current file. See the example at the end of this help file on how to use this task.
The Directory Loop task sets the following variables for use in
the other tasks:
CurrentFilename, CurrentFilesize, CurrentFilepath
Directory
Enter the directory where your files
are located.
Filename
Enter the
filename filter for the files you wish to copy using
the following wildcard rules. This field also supports dynamic
variables. Using dynamic variables, you can select a file
based on current date/time.
Task To Run
Select the desired task to run, if
any of the selected criteria are met. You
can also select multiple tasks to run in sequence, or to run
simultaneously. To run tasks in sequence, use
taskTitle1|taskTitle2|taskTitle3. To run tasks simultaneously, use
taskTitle1&taskTitle2&taskTitle3.
Maximum loops
This is the maximum number of
files that will be processed in each run. If 100 files pass the
criteria, you can process the first 5 files in the list. Enter
0 to process all files that pass the criteria.
Delay between loops
You can enter a delay
time between loops. The delay must be long enough to ensure the
processing task is completed before the next instance of the
processing task is called. You can also enter 0 to run the next loop without delay.
Options
The Task will be run, if the selected
criteria is satisfied. You can select 1 criteria.
1)
File (or files) which satisfy the Filename criteria exists
2)
File (or files) which satisfy the file size criteria. The file
size is entered in kb, but you can specify 0.001 to 1000000 kb.
3)
File (or files) which satisfy the date modification criteria.
Example
Create the following 2 tasks:
1)
Echo task
Task Title = echoTest
message = The current filename
is $%loop::CurrentFilename%$
2) Directory Loop
Task Title = loop
directory = [temp or
test directory]
filename =
Maximum loops = 5
Delay =
15
Task To Run = echoTest
Criteria = Run Task if File exists
Run the Directory Loop task. The directory loop task will run the Echo task for the first 5 files in the directory.
In real situations, you would use either a copy task or a delete
task etc.. For the filename field in these tasks,
use:
$%loop::CurrentFilename%$