[Gambas-user] auto detect pipe |

Bruce Steers bsteers4 at gmail.com
Wed Nov 1 18:39:00 CET 2023


On Wed, 1 Nov 2023 at 17:19, Benoît Minisini <
benoit.minisini at gambas-basic.org> wrote:

> 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'.
>

but i do not wish to know if it via terminal , i wish to know if piped.

It's okay I think i have figured it out by myself now with a well placed
Wait.

BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20231101/e7763557/attachment.htm>


More information about the User mailing list