Issuing native system commands in Scala

前端 未结 5 775
长情又很酷
长情又很酷 2021-02-01 16:42

I want to issue a native system command from a Scala program, and perhaps trap the output. (\"ls\" comes to mind. There may be other ways to get directory information without is

5条回答
  •  猫巷女王i
    2021-02-01 17:05

    Scala is not different from Java in this area, since you can call any Java API functions using Scala's interop features. See for example, java.lang.ProcessBuilder.

提交回复
热议问题