lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On 28 Jun 2013 12:48, "ms2008vip" <ms2008vip@gmail.com> wrote:
>
>
> Howdy:
>
>           I'd like to make the output of tail -F or something similar available to me in Lua without blocking or blocking.
>       If the file gets truncated or log rotated, the program will detect it and will return to the start. This seems to be
>       a level 1 question but looks strange to me. I just can't figure it out. Does anyone could share some code? TKS

Unfortunately other than sleeping and then rechecking the length of the file there is no portable way to do this. You can use platform specific mechanisms eg inotify on Linux to wait for changes.

Justin

> --------------
> ms2008vip
> 2013-06-28
>
>