[Gambas-user] auto detect pipe |

Benoît Minisini benoit.minisini at gambas-basic.org
Wed Nov 1 18:18:00 CET 2023


Le 01/11/2023 à 14:38, Jussi Lahtinen a écrit :
> No time to think, but I guess "if (isatty(STDIN_FILENO))" would work 
> when translated into Gambas. However, my gut feeling is that you are 
> doing something in non-standard way.
> IE there should be another approach for the desired end result. Why do 
> you need this?
> 
> 
> Jussi
> 

The Stream class has a 'IsTerm' property that returns it points at a 
terminal.

So one can test 'File.In.IsTerm'.

Regards,

-- 
Benoît Minisini.



More information about the User mailing list