No need to use libc, the standard library abstracts that. I'd write something like this:
let fd = stdin().as_fd().try_clone_to_owned().unwrap();
let file = File::from(fd);
let meta = file.metadata().unwrap();
dbg!(meta.is_dir());
No need to use libc, the standard library abstracts that. I'd write something like this:
let fd = stdin().as_fd().try_clone_to_owned().unwrap();
let file = File::from(fd);
let meta = file.metadata().unwrap();
dbg!(meta.is_dir());