How do I go about this the right way? I would like to see an example such that it reads stdio and writes the data to a file in real time. Here's my current thought process on how I might do the above. 1. Setup a Command with stdio::piped for stdio, stder and stdin 2. Spawn the ssh command 3. get the stdio handles 4. read the stdio and write to a file stream. 5. Program exits How do I know that the ssh program is done?