Check input device is a terminal: Difference between revisions

no edit summary
(→‎{{header|Kotlin}}: Updated to K/N v0.5)
No edit summary
Line 124:
Who are you? You're not a terminal.
</pre>
 
=={{header|Haskell}}==
 
Example uses [https://hackage.haskell.org/package/unix <tt>unix</tt>] package:
 
<lang haskell>module Main (main) where
import System.Posix.IO (stdInput)
import System.Posix.Terminal (queryTerminal)
main :: IO ()
main = do
isTTY <- queryTerminal stdInput
putStrLn $ if isTTY
then "stdin is TTY"
else "stdin is not TTY"</lang>
 
=={{header|Julia}}==
Anonymous user