Need help with continuous updating input.

I am writing a program that takes pollutant concentration as input and produces AQI as output. The program is a very simple one, and I have beginner to intermediate skills in c++. The program inputs from a file and outputs into another file. But the problem is that the file from which data is inputting updates every 5-10 mins. So my program must be such that it can give an updated output from the updated input without closing the program. Can it be done? If so, how?
i Linux there is a shell command called "dnotify". see manual http://linux.die.net/man/1/dnotify. maybe you can run this command to execute your code every-time the file concerned changes. but this would probably work if the file being updated is overwritten not appended to because then you need to know where to start reading new data from. this doesn't need your program to be changed. maybe this helps.
Topic archived. No new replies allowed.