[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How can I find out whether my program is running interactively?
- From: Elias Barrionovo <elias.tandel@...>
- Date: Sat, 5 Nov 2011 21:55:13 -0200
On 4 November 2011 09:25, Luiz Henrique de Figueiredo
>> I want my program to print out a message when io.stdout is a terminal,
>> but not when it is a disk file. Current solution: write it to
>> io.stderr, not io.stdout. Is there a better way?
> Under Unix, you can write to /dev/tty.
Wouldn't it remove the user's possibility of doing io redirections (not sure how those are actually called)? Things like ' lua myscript.lua >> mylog.txt ' ?