I use a thread to constantly read a file content it checks for update every 5 sec (i use sleep) Is there a better way to tail a file. Also i user aborts a program how do i make sure that fileReader is closed? Thank you.
posted 15 years ago
Hi, Check out the Observer pattern in the Design Patterns Books. It is helpful in what you want to do. Basically it is just like the jave Event model where in there is a listener which invokes a method on an Event. For example in your case if you change the file in any way maybe you can raize an event. ------------------ Regds. Mahindrakar