Answers to: Programming logic questionhttp://linuxexchange.org/questions/832/programming-logic-question<p>I'm looking for a high level view of how to get a program to tail a file continuously, not at intervals, and actually act on the data it has...whiles till continuously monitoring the file.</p> <p>I'm running into a mental block trying to figure out how to keep the program monitoring, which a while(1=1) loop would certainly accomplish, but how do you act on the data you've gathered, while still monitoring the file...</p> <p>If you exit the loop to act on the data, how do you still keep tabs on where you are in the file, it seems to me these need to be done in parallel...what am I missing?</p> <p>If you need a more concise or clear answer please let me know, I'm having a hard time getting my mind wrapped around this. Thoughts?</p> <p>Thanks,</p> <p>-Rob</p>enWed, 06 Mar 2013 01:16:18 -0500Answer by darkonchttp://linuxexchange.org/questions/832/programming-logic-question/3066<p>One thing to be aware of is that -- if you're using fgets, you should call setlinebuf to set line-buffering so that you don't get stuck waiting for time-critical data to clear the buffers.</p>darkoncWed, 06 Mar 2013 01:16:18 -0500http://linuxexchange.org/questions/832/programming-logic-question/3066