You'd want something more like this:
open(last_sim_log) do fh
This does a couple of things:
1. Use the open(...) do fh ... end construct to ensure file closing.
2. Check for stream end using eof(fh) instead of catching an error.
On Fri, Sep 16, 2016 at 5:06 AM, <adrian_le...@hushmail.com> wrote:
> Thanks for the replies,
> For some reason only one chunk of data is printed even though the log is
> still being written to
> fh = open(last_sim_log)
> while true
> For readavailable(fh), I getting "no method matching
> Many Thanks
> On 9/15/2016 at 4:24 PM, "Stefan Karpinski" <ste...@karpinski.org> wrote:
> >If you don't mind blocking when a complete line isn't available,
> >you can
> >just call readline(io) repeatedly.
> >On Thu, Sep 15, 2016 at 7:57 AM, Steven G. Johnson
> >> On Thursday, September 15, 2016 at 7:11:55 AM UTC-4, Adrian
> >Lewis wrote:
> >>> I have an active log and I wondered how I could `tail -f` this
> >>> running the Unix command?
> >> Open the file and repeatedly call `readavailable`