使い方
usingFile("foo.txt") {
 out =>
  val w = new PrintWriter(out)
  w.println("firstLine")
  w.println("secondLine")
}