Execute a system command: Difference between revisions

Line 902:
<lang scala>// version 1.0.6
 
import java.util.*Scanner
 
fun main(args: Array<String>) {
val proc = Runtime.getRuntime().exec("cmd /C dir") // testing on Windows 10
val scan = Scanner(proc.inputStream).use {
while (scanit.hasNextLine()) println(scanit.nextLine())
scan.close()}
}</lang>