Permalink
Browse files

[enhance] system: bsl function Sys.process.exec binded

  • Loading branch information...
1 parent 37ce9a6 commit f4bb8f30160c0fef7232cd1bf0b6ebf69b6a5b49 Nicolas Glondu committed Oct 20, 2011
Showing with 12 additions and 0 deletions.
  1. +12 −0 stdlib/system/system.opa
@@ -123,4 +123,16 @@ gethostsbyname = %%BslSys.gethostsbyname%% : string -> list(ip)
*/
get_memory_usage = %%bslSys.get_memory_usage%% : -> int
+/**
+ * [exec(command, input)]
+ * acts like: echo input | command > output
+ *
+ * Primitive for calling an external command, and returning the string
+ * built from the resulting stdout of the command, given an input to
+ * produce on the stdin of the process.
+ * In case of error, return the error message instead of the process output.
+ * @return raw result
+ */
+exec = %%bslSys.process.exec%% : string, string -> string
+
}}

0 comments on commit f4bb8f3

Please sign in to comment.