Gene Tani
12/9/2005 10:19:00 PM
Michael Ulm wrote:
> I want to analyze a log file using ruby. What is
> the most Ruby-like method to check the file for new
> entries (they will be appended to the file) and
> then get those new entries into the system?
>
> I have a feeling that this should be rather simple,
> but I can't think of an elegant way.
>
> Thanks,
>
> Michael
>
> --
> Michael Ulm
> R&D Team
> ISIS Information Systems Austria
> tel: +43 2236 27551-219, fax: +43 2236 21081
> e-mail: michael.ulm@isis-papyrus.com
> Visit our Website: www.isis-papyrus.com
Comment, since I don't have an answer for you: this is very
O/S-specific, esp win32. (also helps to mention which ruby release
you're using, and how you installed it) In general (non-win32), you
could probably combine combine code that watches directories for
changes, either by storing mtimes in a dict, or by fcntl, with a
tail-type utility.