Anonymous user
Check output device is a terminal: Difference between revisions
→{{header|Rust}}: Updated to the Rust 1.2.0
(J) |
(→{{header|Rust}}: Updated to the Rust 1.2.0) |
||
Line 235:
</lang>
=={{header|Rust}}==
<lang rust>/*
fn main() {
let istty = unsafe { libc::isatty(libc::STDOUT_FILENO as i32) } != 0;
if
println!("stdout is tty");
} else {
println!("stdout is not tty");
}
}</lang>
|