-
-
Save d9k/7cd9db30a117c40e5a5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; original @link https://gist.github.com/codification/1984857 | |
(ns proc | |
(:import [java.lang ProcessBuilder]) | |
(:use [clojure.java.io :only [reader writer]])) | |
(defn spawn [& args] | |
(let [process (-> (ProcessBuilder. args) | |
(.start))] | |
{:out (-> process | |
(.getInputStream) | |
(reader)) | |
:err (-> process | |
(.getErrorStream) | |
(reader)) | |
:in (-> process | |
(.getOutputStream) | |
(writer)) | |
:process process})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment