How does the “scala.sys.process” from Scala 2.9 work?

前端 未结 7 1086
甜味超标
甜味超标 2020-11-30 18:09

I just had a look at the new scala.sys and scala.sys.process packages to see if there is something helpful here. However, I am at a complete loss.<

相关标签:
7条回答
  • 2020-11-30 18:46

    Has anybody got an example on how to actually start a process?

    import sys.process._ // Package object with implicits!
    "ls"!
    

    And, which is most interesting for me: Can you detach processes?

    "/path/to/script.sh".run()
    

    Most of what you'll do is related to sys.process.ProcessBuilder, the trait. Get to know that.

    There are implicits that make usage less verbose, and they are available through the package object sys.process. Import its contents, like shown in the examples. Also, take a look at its scaladoc as well.

    0 讨论(0)
提交回复
热议问题