› Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › fileset-local in run mode at process start › Reply To: fileset-local in run mode at process start
After my original post on this topic, I echoed some keylist commands to confirm that the proc arguments didn’t contain anything I could use to identify that the thread had just started. I also put echo statements in each of the possible modes and learned that at startup the proc gets executed in BOTH ‘start’ mode and then ‘run’ mode.
I thought about using an Alert to check for the file’s existence rather than the dirParse proc of the inbound fileset-local thread, but ‘file change’ just fills the log with errors that it can’t status a file that doesn’t exist, which doesn’t trigger the associated alert action proc.
So, my solution was to global a variable called something like, “(proc_name)_startup”, and in the ‘start’ mode I set it to a value of “1”. In the ‘run’ mode I have an if statement that when the variable is set on, it just sets it back to “0”, else it executes all the rest of the code I want to occur in the normal ‘run’ mode. That way the first ‘run’ that occurs after a startup just sets the startup flag off. And the subsequent ‘run’ that is triggered by the advanced scheduling performs the actions I only want to happen at that time. This seems to work so far in testing, but that’s never quite the same as real life.