I am trying to create a polling script that will monitor a particular directory for a filetype. If the file is found, it will launch and application and do stuff and exit from the application.
The idea is for someone to drop the file in the specified directory and get the processed files almost immediately. The responsibility of processing the file lies with me, but it is an automatable process. In a nutshell the following needs to be done.
1. Monitor Folder for *.txt files
2. If file found, launch application and open txt file, process it, and then save as <fileName>.new, delete <fileName>.txt
3. Exit application
I need to run this repeatedly as a service. How can i achieve that ?