lua-users home
lua-l archive

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


Why does io.write and io.flush make a script not run if stdout is not
a terminal? This is news to me and sounds pretty akward.. Are you
sure?

On Sun, Nov 20, 2011 at 1:37 PM, PooshhMao <pooshhmao@gmail.com> wrote:
> Hi,
>
> My program prints stuff to the console. Most of the time I use just print(),
> but in some cases I prefer to use io.write() and io.flush(), for example to
> show progress on an
> operation. The problem is that, when I do, the Lua script won't run anymore
> if not executed from a terminal. At any rate, there's little point in
> showing stuff in the terminal if it's not visible, so I suppose I would need
> to set the standard output to a file. So how can I determine if the script
> is run from a terminal or not?
>
> I use LuaJIT on Kubuntu Linux, if that matters.
>
> Thanks in advance
>
> Ralf
>
>
>
>
>
>
>
>
>
>
>
>