Wayne Stallwood writes:
What is the most efficient way to "watch" a folder for a particular file pattern, if I have a looping "if exist" script is this likely to consume lots of resources as surely it would be continuously polling the disk to check for that file.
You could use `sleep' to suspend your script for a few seconds within the `if exists' loop.
I had to do something similar in the past and my preferred solution was to use tclsh as I was able to time how long the file copying took and then sleep (`after' in Tcl) for an amount of time that made the copying happen at regular intervals.
(Please: no rants about my choice of scripting language!)
HTH.
..Adrian