Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Executing a system command in Haskell

How could I execute a system command such as cp somefile somedestination in Haskell?

Something like an os.Exec.

like image 338
Clark Gaebel Avatar asked Aug 12 '10 18:08

Clark Gaebel


1 Answers

The Haskell 98 standard provides:

System.system :: String
              -> IO GHC.IO.Exception.ExitCode

which executes a command.

The new System.Process library is more useful though, allowing for portable input/output redirection and so forth.

like image 171
Don Stewart Avatar answered Sep 20 '22 18:09

Don Stewart