I want my application to be able to read the input from a redirected file stream through source > my_app
, but I do not want it to ask for user input in case there is no redirection.
C provides such methods (Checking the stdin buffer if it's empty) but I could not find any solution for Rust.