Check input device is a terminal: Difference between revisions

→‎{{header|Rust}}: Switched STDOUT to STDIN
(→‎{{header|Rust}}: Updated to the Rust 1.2.0)
(→‎{{header|Rust}}: Switched STDOUT to STDIN)
Line 213:
 
fn main() {
let istty = unsafe { libc::isatty(libc::STDOUT_FILENOSTDIN_FILENO as i32) } != 0;
if istty {
println!("stdout is tty");