[scala] How to write to a file in Scala?