Jump to content

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>
 
9,490

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.