Skip to content

Instantly share code, notes, and snippets.

@kmizu
Created May 6, 2011 07:56
Show Gist options
  • Save kmizu/958587 to your computer and use it in GitHub Desktop.
Save kmizu/958587 to your computer and use it in GitHub Desktop.
object ExecDir {
def main(args: Array[String]) {
val process = Runtime.getRuntime().exec("dir")
val in = process.getInputStream()
val it = Iterator.continually(in.read())
println(it.takeWhile(_ != -1).map{_.toChar}.mkString)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment