title: Redirecting stdin and stdout in scala
body: <p>How can I redirect STDIN and STDOUT to files?</p>
  
  <p>In C, this would be done like so:</p>
  
  <pre><code>freopen("file.in","r",stdin);
  </code></pre>
  
  <p>I am looking for something equivalent for Scala.</p>