title: scala : creating directory and file
body: <p>I am trying to create a temp directory and file underneath it. Here is my code snippet:</p>
  
  <pre><code>var tempPath = System.getProperty("java.io.tmpdir")
  val myDir = new File(tempPath.concat(scala.util.Random.nextString(10).toString))
  myDir.mkdir()
  
  val tempFile = new File(myDir.toString+"/temp.log")
  </code></pre>
  
  <p>This code is working fine. However I am wondering if there is any better way of doing this, please provide your comments.</p>