stdin and stdout

Functions to redirect the in and out from and to files. Also died a
minor error.