我有一个类型的功能:
main :: IO ()
main = do
putStln "before executing"
execute "java -jar my.jar"
putStln "after executing"
。
我想执行外部过程,类似的东西:
{{1}}
怎么做?
答案 0 :(得分:1)
使用System.Process
模块。一个例子:
import System.Process
main = do
putStrLn "before executing"
createProcess (proc "java" ["-jar", "my.jar"])
putStrLn "after executing"