Check input device is a terminal: Difference between revisions
m
no edit summary
mNo edit summary |
|||
Line 67:
</syntaxhighlight>
=={{header|FutureBasic}}==▼
<syntaxhighlight lang="futurebasic">▼
include "NSLog.incl"▼
BeginCCode▼
if (isatty(fileno(stdin)))▼
NSLog( @"stdin is connected to a terminal" );▼
else▼
NSLog( @"stdin is NOT connected to a terminal" );▼
EndC▼
HandleEvents▼
</syntaxhighlight>▼
{{output}}▼
<pre>▼
stdin is NOT connected to a terminal▼
</pre>▼
=={{header|C}}==
Line 189 ⟶ 172:
C:\test < in.txt
Input doesn't come from tty.</pre>
▲=={{header|FutureBasic}}==
▲<syntaxhighlight lang="futurebasic">
▲include "NSLog.incl"
▲BeginCCode
▲ if (isatty(fileno(stdin)))
▲ NSLog( @"stdin is connected to a terminal" );
▲ else
▲ NSLog( @"stdin is NOT connected to a terminal" );
▲EndC
▲HandleEvents
▲</syntaxhighlight>
▲{{output}}
▲<pre>
▲stdin is NOT connected to a terminal
▲</pre>
=={{header|Go}}==
|