Check output device is a terminal: Difference between revisions
Added Kotlin
m (→{{header|Haskell}}: ( applied hindent )) |
(Added Kotlin) |
||
Line 177:
<pre>
This program sees STDOUT as a TTY.
</pre>
=={{header|Kotlin}}==
{{Works with|Ubuntu|14.04}}
<lang scala>// Kotlin Native version 0.2
import unistd.*
fun main(args: Array<String>) {
if (isatty(STDOUT_FILENO) != 0)
println("stdout is a terminal")
else
println("stdout is not a terminal")
}</lang>
{{out}}
<pre>
stdout is a terminal
</pre>
|