Check input device is a terminal: Difference between revisions

→‎{{header|Rust}}: Updated to the Rust 1.2.0
(→‎{{header|Julia}}: A new entry for Julia)
(→‎{{header|Rust}}: Updated to the Rust 1.2.0)
Line 208:
 
=={{header|Rust}}==
<lang rust>/*Rust 0.9 version. Uses C library interface */
 
extern mod std;
useextern crate std::libc;
 
fn main() {
let istty = unsafe { libc::isatty(libc::STDIN_FILENOSTDOUT_FILENO as i32) } != 0;
if (istty) {
println!("stdinstdout is tty");
} else {
println!("stdinstdout is not tty");
}
}</lang>