It would probably help if you could provide a better description of exactly what you are trying to do.
From what you have posted with your question I think that you want a script to run continuously or repeatedly, which finds all subdirectories and files along some path matching a pattern like /BaseFolder*/.../wf?.txt, change CWD to that directory and invoke Program_name with the file name. If new directories or files are added it should find them the next time the script is run.
I would suggest using a simple wrapper script (prog_wrapper) which is invoked by a cron rule (cron_wrapper) which uses find to locate the target files and paths.
In pseudo-code, it might look something like this:
Code:
cron wrapper {
find /BaseFolder* -type f -name wf?.txt -exec prog_wrapper {} ;
}
prog_wrapper {
cd dirname $1
Program_name --input basename $1
}
You could implement that as a shell script or in any scripting language with which you are familiar.